Search code examples
pythonopenai-api

Check if a fine-tuned OpenAI model was successfully deleted


I am doing some work with the OpenAI API with Python. I'm working with fine-tuning and I am working on deleting an existing model and starting over again. I want to be able to check if the deletion actually succeeded or failed.

The OpenAI.models.delete() function returns a ModelDeleted object. What should I do with it?


Solution

  • A ModelDeleted object has a boolean deleted attribute which tells you whether the model was deleted.

    API reference

    Python source code