soaljack commited on
Commit
7c2862e
·
verified ·
1 Parent(s): 70bd6eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -29
app.py CHANGED
@@ -1,42 +1,18 @@
1
- from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
2
- import datetime
3
- import requests
4
- import pytz
5
- import yaml
6
  from tools.final_answer import FinalAnswerTool
7
-
8
  from Gradio_UI import GradioUI
9
 
10
-
11
- final_answer = FinalAnswerTool()
12
-
13
- # 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:
14
- # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
15
-
16
  model = HfApiModel(
17
- max_tokens=2096,
18
- temperature=0.5,
19
- model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
20
- custom_role_conversions=None,
21
  )
22
 
23
-
24
- with open("prompts.yaml", 'r') as stream:
25
- prompt_templates = yaml.safe_load(stream)
26
-
27
  agent = CodeAgent(
28
  model=model,
29
- tools=[final_answer], ## add your tools here (don't remove final answer)
30
  max_steps=6,
31
  verbosity_level=1,
32
- grammar=None,
33
- planning_interval=None,
34
- name=None,
35
- description=None,
36
- prompt_templates=prompt_templates
37
  )
38
 
39
-
40
-
41
-
42
  GradioUI(agent).launch()
 
1
+ from smolagents import CodeAgent, HfApiModel
 
 
 
 
2
  from tools.final_answer import FinalAnswerTool
 
3
  from Gradio_UI import GradioUI
4
 
 
 
 
 
 
 
5
  model = HfApiModel(
6
+ max_tokens=2096,
7
+ temperature=0.5,
8
+ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
 
9
  )
10
 
 
 
 
 
11
  agent = CodeAgent(
12
  model=model,
13
+ tools=[FinalAnswerTool()],
14
  max_steps=6,
15
  verbosity_level=1,
 
 
 
 
 
16
  )
17
 
 
 
 
18
  GradioUI(agent).launch()