Spaces:
Running
Running
Commit
·
d83bb1c
1
Parent(s):
4a03688
Added o1
Browse files
app.py
CHANGED
|
@@ -84,6 +84,9 @@ def create_llm_engine(type_engine: str, api_key: str = None):
|
|
| 84 |
if type_engine == "openai/gpt-4o" and api_key:
|
| 85 |
llm_engine = LiteLLMModel(model_id="openai/gpt-4o", api_key=api_key)
|
| 86 |
return llm_engine
|
|
|
|
|
|
|
|
|
|
| 87 |
elif type_engine == "openai/gpt-4o" and not api_key:
|
| 88 |
raise ValueError("You need to provide an API key to use the the model engine.")
|
| 89 |
elif type_engine == "Qwen/Qwen2.5-Coder-32B-Instruct":
|
|
@@ -121,7 +124,7 @@ df_sample_routes = pd.DataFrame(sample_data)
|
|
| 121 |
|
| 122 |
# Default engine
|
| 123 |
if os.environ.get("OPENAI_API_KEY"):
|
| 124 |
-
default_engine = create_llm_engine("openai/
|
| 125 |
else:
|
| 126 |
default_engine = create_llm_engine("Qwen/Qwen2.5-Coder-32B-Instruct")
|
| 127 |
|
|
|
|
| 84 |
if type_engine == "openai/gpt-4o" and api_key:
|
| 85 |
llm_engine = LiteLLMModel(model_id="openai/gpt-4o", api_key=api_key)
|
| 86 |
return llm_engine
|
| 87 |
+
elif type_engine == "openai/o1" and api_key:
|
| 88 |
+
llm_engine = LiteLLMModel(model_id="openai/o1", api_key=api_key)
|
| 89 |
+
return llm_engine
|
| 90 |
elif type_engine == "openai/gpt-4o" and not api_key:
|
| 91 |
raise ValueError("You need to provide an API key to use the the model engine.")
|
| 92 |
elif type_engine == "Qwen/Qwen2.5-Coder-32B-Instruct":
|
|
|
|
| 124 |
|
| 125 |
# Default engine
|
| 126 |
if os.environ.get("OPENAI_API_KEY"):
|
| 127 |
+
default_engine = create_llm_engine("openai/o1", os.environ.get("OPENAI_API_KEY"))
|
| 128 |
else:
|
| 129 |
default_engine = create_llm_engine("Qwen/Qwen2.5-Coder-32B-Instruct")
|
| 130 |
|