thatting commited on
Commit
839697a
·
verified ·
1 Parent(s): 1ec27e9

Update app.py

Browse files

Create an instance of the gpt-4o model

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,14 +13,14 @@ os.system('pip install openai')
13
 
14
  # Import modules and classes from openai and smolagents
15
  # import openai
16
- from smolagents import CodeAgent, HfApiModel, DuckDuckGoSearchTool, VisitWebpageTool, PythonInterpreterTool, SpeechToTextTool
17
 
18
  # Create API keys
19
  openai.api_key = ('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')
20
  # GoogleSearch.SERP_API_KEY = 'a2fa0feab384c372147075f190fe5878300bbbb693eb0aced535e5d58189ad70'
21
 
22
  # Create model
23
- model = HfApiModel()
24
 
25
  # (Keep Constants as is)
26
  # --- Constants ---
 
13
 
14
  # Import modules and classes from openai and smolagents
15
  # import openai
16
+ from smolagents import CodeAgent, OpenAIServerModel, DuckDuckGoSearchTool, VisitWebpageTool, PythonInterpreterTool, SpeechToTextTool
17
 
18
  # Create API keys
19
  openai.api_key = ('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')
20
  # GoogleSearch.SERP_API_KEY = 'a2fa0feab384c372147075f190fe5878300bbbb693eb0aced535e5d58189ad70'
21
 
22
  # Create model
23
+ model = OpenAIServerModel(model_id="gpt-4o")
24
 
25
  # (Keep Constants as is)
26
  # --- Constants ---