Ubik80 commited on
Commit
f326d8d
·
verified ·
1 Parent(s): 596178b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,14 +1,14 @@
1
  import os
2
-
3
- from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
4
  import datetime
5
  import requests
6
  import pytz
7
  import yaml
8
  from tools.final_answer import FinalAnswerTool
9
-
10
  from Gradio_UI import GradioUI
11
 
 
12
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
13
  @tool
14
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
@@ -41,7 +41,6 @@ final_answer = FinalAnswerTool()
41
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
42
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
43
 
44
- from smolagents import OpenAIServerModel
45
 
46
  model = OpenAIServerModel(
47
  max_tokens=2096,
 
1
  import os
2
+ os.system("pip install 'smolagents[openai]'") # ✅ Installa SmolAgents con OpenAI
3
+ from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool, OpenAIServerModel
4
  import datetime
5
  import requests
6
  import pytz
7
  import yaml
8
  from tools.final_answer import FinalAnswerTool
 
9
  from Gradio_UI import GradioUI
10
 
11
+
12
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
13
  @tool
14
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
 
41
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
42
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
43
 
 
44
 
45
  model = OpenAIServerModel(
46
  max_tokens=2096,