MCPcopy Create free account
hub / github.com/AmberSahdev/Open-Interface / create_model

Method create_model

app/models/factory.py:8–20  ·  view source on GitHub ↗
(model_name, *args)

Source from the content-addressed store, hash-verified

6class ModelFactory:
7 @staticmethod
8 def create_model(model_name, *args):
9 try:
10 if model_name == 'gpt-4o' or model_name == 'gpt-4o-mini':
11 return GPT4o(model_name, *args)
12 elif model_name == 'gpt-4-vision-preview' or model_name == 'gpt-4-turbo':
13 return GPT4v(model_name, *args)
14 elif model_name.startswith("gemini"):
15 return Gemini(model_name, *args[1:])
16 else:
17 # Llama/Llava models will work with the standard code I wrote for GPT4V without the assitant mode features of gpt4o
18 return GPT4v(model_name, *args)
19 except Exception as e:
20 raise ValueError(f'Unsupported model type {model_name}. Create entry in app/models/. Error: {e}')

Callers 1

__init__Method · 0.80

Calls 3

GPT4oClass · 0.90
GPT4vClass · 0.90
GeminiClass · 0.90

Tested by

no test coverage detected