■ OpenAI 클래스의 models 변수를 사용해 모델을 삭제하는 방법을 보여준다.
▶ main.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import os from openai import OpenAI os.environ["OPENAI_API_KEY"] = "<OPENAI_API_KEY>" openAI = OpenAI() modelName = "ft:davinci-002:personal::9X8MBUWt" # 모델명을 설정한다. modelDeleted = openAI.models.delete(modelName) print(modelDeleted) """ ModelDeleted(id = 'ft:davinci-002:personal::9X8MBUWt', deleted = True, object = 'model') """ |
▶ requirements.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
annotated-types==0.7.0 anyio==4.4.0 certifi==2024.6.2 distro==1.9.0 exceptiongroup==1.2.1 h11==0.14.0 httpcore==1.0.5 httpx==0.27.0 idna==3.7 openai==1.31.1 pydantic==2.7.3 pydantic_core==2.18.4 sniffio==1.3.1 tqdm==4.66.4 typing_extensions==4.12.1 |