WingNeville commited on
Commit
dbd0c30
·
verified ·
1 Parent(s): e89fc7b

Upload agent

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -8,25 +8,25 @@ CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
8
  from tools.web_search import DuckDuckGoSearchTool as WebSearch
9
  from tools.final_answer import FinalAnswerTool as FinalAnswer
10
 
11
- # Initialize model
 
12
  model = InferenceClientModel(
13
- model='Qwen/Qwen2.5-Coder-32B-Instruct',
14
- model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
15
  )
16
 
17
- # Initialize tools
18
  web_search = WebSearch()
19
  final_answer = FinalAnswer()
20
 
21
- # Load prompt templates from YAML file
22
  with open(os.path.join(CURRENT_DIR, "prompts.yaml"), 'r') as stream:
23
  prompt_templates = yaml.safe_load(stream)
24
 
25
- # Initialize the CodeAgent
26
  agent = CodeAgent(
27
  model=model,
28
  tools=[web_search],
29
  managed_agents=[],
 
30
  max_steps=20,
31
  verbosity_level=1,
32
  grammar=None,
@@ -38,7 +38,5 @@ agent = CodeAgent(
38
  max_print_outputs_length=None,
39
  prompt_templates=prompt_templates
40
  )
41
-
42
- # Launch the Gradio UI
43
  if __name__ == "__main__":
44
- GradioUI(agent).launch()
 
8
  from tools.web_search import DuckDuckGoSearchTool as WebSearch
9
  from tools.final_answer import FinalAnswerTool as FinalAnswer
10
 
11
+
12
+
13
  model = InferenceClientModel(
14
+ model='Qwen/Qwen2.5-Coder-32B-Instruct',
15
+ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
16
  )
17
 
 
18
  web_search = WebSearch()
19
  final_answer = FinalAnswer()
20
 
21
+
22
  with open(os.path.join(CURRENT_DIR, "prompts.yaml"), 'r') as stream:
23
  prompt_templates = yaml.safe_load(stream)
24
 
 
25
  agent = CodeAgent(
26
  model=model,
27
  tools=[web_search],
28
  managed_agents=[],
29
+ class='CodeAgent',
30
  max_steps=20,
31
  verbosity_level=1,
32
  grammar=None,
 
38
  max_print_outputs_length=None,
39
  prompt_templates=prompt_templates
40
  )
 
 
41
  if __name__ == "__main__":
42
+ GradioUI(agent).launch()