test_openai_fine_tuning

This commit is contained in:
Ishaan Jaff
2025-02-15 16:59:27 -08:00
parent 5fc008626f
commit 8f8ed69fff
@@ -16,7 +16,7 @@ async def test_openai_fine_tuning():
file_path = os.path.join(_current_dir, file_name)
response = await client.files.create(
extra_body={"custom_llm_provider": "azure"},
extra_body={"custom_llm_provider": "openai"},
file=open(file_path, "rb"),
purpose="fine-tune",
)
@@ -28,9 +28,9 @@ async def test_openai_fine_tuning():
# create fine tuning job
ft_job = await client.fine_tuning.jobs.create(
model="gpt-35-turbo-0613",
model="gpt-3.5-turbo",
training_file=response.id,
extra_body={"custom_llm_provider": "azure"},
extra_body={"custom_llm_provider": "openai"},
)
print("response from ft job={}".format(ft_job))
@@ -40,7 +40,7 @@ async def test_openai_fine_tuning():
# list all fine tuning jobs
list_ft_jobs = await client.fine_tuning.jobs.list(
extra_query={"custom_llm_provider": "azure"}
extra_query={"custom_llm_provider": "openai"}
)
print("list of ft jobs={}".format(list_ft_jobs))
@@ -48,7 +48,7 @@ async def test_openai_fine_tuning():
# cancel specific fine tuning job
cancel_ft_job = await client.fine_tuning.jobs.cancel(
fine_tuning_job_id=ft_job.id,
extra_body={"custom_llm_provider": "azure"},
extra_body={"custom_llm_provider": "openai"},
)
print("response from cancel ft job={}".format(cancel_ft_job))
@@ -58,5 +58,5 @@ async def test_openai_fine_tuning():
# delete OG file
await client.files.delete(
file_id=response.id,
extra_body={"custom_llm_provider": "azure"},
extra_body={"custom_llm_provider": "openai"},
)