mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
add test for ft endpoints on azure
This commit is contained in:
parent
c8dfc95e90
commit
287b09cff6
4 changed files with 74 additions and 5 deletions
23
tests/test_openai_fine_tuning.py
Normal file
23
tests/test_openai_fine_tuning.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
from openai import AsyncOpenAI
|
||||
import os
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_openai_fine_tuning():
|
||||
"""
|
||||
[PROD Test] Ensures logprobs are returned correctly
|
||||
"""
|
||||
client = AsyncOpenAI(api_key="sk-1234", base_url="http://0.0.0.0:4000")
|
||||
|
||||
file_name = "openai_batch_completions.jsonl"
|
||||
_current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
file_path = os.path.join(_current_dir, file_name)
|
||||
|
||||
response = await client.files.create(
|
||||
extra_body={"custom_llm_provider": "azure"},
|
||||
file=open(file_path, "rb"),
|
||||
purpose="fine-tune",
|
||||
)
|
||||
|
||||
print("response from files.create: {}".format(response))
|
Loading…
Add table
Add a link
Reference in a new issue