Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename _run_openai_chat->run_openai_chat, fix usage in asr.py #569

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading