Skip to content

Commit

Permalink
fix backup model logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rishsriv committed Dec 13, 2024
1 parent c88ee19 commit 519959f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions defog_utils/utils_multi_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ async def chat_async(

for attempt in range(max_retries):
try:
if attempt == 0:
# First attempt, use the original model
pass
else:
# Subsequent attempts, use the backup model
if attempt > 0 and backup_model is not None:
# For the first attempt, use the original model
# For subsequent attempts, use the backup model if it is provided
model = backup_model
return await llm_function(
model=model,
Expand Down

0 comments on commit 519959f

Please sign in to comment.