mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix whisper health check with litellm
This commit is contained in:
parent
711496e260
commit
e3142b4294
1 changed files with 11 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
import types
|
import types
|
||||||
|
@ -1870,6 +1871,16 @@ class OpenAIChatCompletion(BaseLLM):
|
||||||
model=model, # type: ignore
|
model=model, # type: ignore
|
||||||
prompt=prompt, # type: ignore
|
prompt=prompt, # type: ignore
|
||||||
)
|
)
|
||||||
|
elif mode == "audio_transcription":
|
||||||
|
# Get the current directory of the file being run
|
||||||
|
pwd = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
file_path = os.path.join(pwd, "../tests/gettysburg.wav")
|
||||||
|
audio_file = open(file_path, "rb")
|
||||||
|
completion = await client.audio.transcriptions.with_raw_response.create(
|
||||||
|
file=audio_file,
|
||||||
|
model=model, # type: ignore
|
||||||
|
prompt=prompt, # type: ignore
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
raise Exception("mode not set")
|
raise Exception("mode not set")
|
||||||
response = {}
|
response = {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue