Skip to content

Commit

Permalink
Fixed error that was not allowing llama/llava and other models
Browse files Browse the repository at this point in the history
  • Loading branch information
AmberSahdev committed Nov 9, 2024
1 parent e723948 commit 2d68ea4
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions app/models/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
class ModelFactory:
@staticmethod
def create_model(model_name, *args):
if model_name == 'gpt-4o':
return GPT4o(model_name, *args)
elif model_name == 'gpt-4-vision-preview' or model_name == 'gpt-4-turbo':
return GPT4v(model_name, *args)
else:
raise ValueError(f'Unsupported model type {model_name}. Create entry in app/models/')
try:
if model_name == 'gpt-4o':
return GPT4o(model_name, *args)
elif model_name == 'gpt-4-vision-preview' or model_name == 'gpt-4-turbo':
return GPT4v(model_name, *args)
else:
# Llama/Llava models will work with the standard code I wrote for GPT4V without the assitant mode features of gpt4o
return GPT4v(model_name, *args)
except Exception as e:
raise ValueError(f'Unsupported model type {model_name}. Create entry in app/models/. Error: {e}')

0 comments on commit 2d68ea4

Please sign in to comment.