Skip to content

Commit

Permalink
Merge pull request #569 from GooeyAI/fix-openai-audio-asr
Browse files Browse the repository at this point in the history
rename _run_openai_chat->run_openai_chat, fix usage in asr.py
  • Loading branch information
nikochiko authored Dec 18, 2024
2 parents 6ee37e0 + 8619f54 commit f814a30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions daras_ai_v2/asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,12 +1112,12 @@ def run_asr(
raise_for_status(r)
data = r.json()
elif selected_model == AsrModels.gpt_4_o_audio:
from daras_ai_v2.language_model import _run_openai_chat
from daras_ai_v2.language_model import run_openai_chat

audio_r = requests.get(audio_url)
raise_for_status(audio_r, is_user_url=True)

return _run_openai_chat(
return run_openai_chat(
model=asr_model_ids[selected_model],
messages=[
{
Expand All @@ -1137,7 +1137,7 @@ def run_asr(
],
},
],
max_tokens=4096,
max_completion_tokens=4096,
num_outputs=1,
temperature=1,
)[0]["content"]
Expand Down
4 changes: 2 additions & 2 deletions daras_ai_v2/language_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def _run_chat_model(
)
match api:
case LLMApis.openai:
return _run_openai_chat(
return run_openai_chat(
model=model,
avoid_repetition=avoid_repetition,
max_completion_tokens=max_tokens,
Expand Down Expand Up @@ -1027,7 +1027,7 @@ def _run_anthropic_chat(


@retry_if(openai_should_retry)
def _run_openai_chat(
def run_openai_chat(
*,
model: str,
messages: list[ConversationEntry],
Expand Down

0 comments on commit f814a30

Please sign in to comment.