Skip to content

Commit

Permalink
add support for chatgpt-4o-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
zwcolin committed Aug 19, 2024
1 parent 6747cbc commit d3025cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/generate_lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def generate_response_remote_wrapper(generate_fn,
try:
result = generate_fn(image, query, model_path,
api_key=api_key, client=client, random_baseline=False)
except:
except Exception as e:
print(f"Error: {e}")
print(f"Error {curr_retries}, sleeping for {sleep_time} seconds...")
time.sleep(sleep_time)
curr_retries += 1
Expand All @@ -39,6 +40,7 @@ def get_client_fn(model_path):
# gpt
elif model_path in ['gpt-4o-2024-05-13',
'gpt-4o-2024-08-06',
'chatgpt-4o-latest',
'gpt-4-turbo-2024-04-09',
'gpt-4o-mini-2024-07-18']:
from .gpt import get_client_model
Expand Down Expand Up @@ -84,6 +86,7 @@ def get_generate_fn(model_path):
# gpt
elif model_name in ['gpt-4o-2024-05-13',
'gpt-4o-2024-08-06',
'chatgpt-4o-latest',
'gpt-4-turbo-2024-04-09',
'gpt-4o-mini-2024-07-18']:
from .gpt import generate_response
Expand Down

0 comments on commit d3025cf

Please # to comment.