tagny commited on
Commit
51264a9
·
verified ·
1 Parent(s): 6205d71

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -1
app.py CHANGED
@@ -5,7 +5,7 @@ import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
7
 
8
- from Gradio_UI import GradioUI, AgentCloner
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
@@ -73,4 +73,31 @@ tools = [final_answer], ## add your tools here (don't remove final answer)
73
  # )
74
 
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  GradioUI(AgentCloner(tools, prompt_templates)).launch()
 
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
7
 
8
+ from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
 
73
  # )
74
 
75
 
76
+ class AgentCloner:
77
+ def __init__(self, avalaible_tools: list[callable], prompt_templates: list[dict]) -> None:
78
+ self.avalaible_tools = avalaible_tools
79
+ self.prompt_templates = prompt_templates
80
+
81
+ def clone(self):
82
+ new_model_client = HfApiModel(
83
+ max_tokens=2096,
84
+ temperature=0.5,
85
+ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
86
+ custom_role_conversions=None,
87
+ )
88
+ final_answer = FinalAnswerTool()
89
+ new_agent = CodeAgent(
90
+ model=new_model_client,
91
+ # tools=self.avalaible_tools,
92
+ tools=[final_answer],
93
+ max_steps=6,
94
+ verbosity_level=1,
95
+ grammar=None,
96
+ planning_interval=None,
97
+ name=None,
98
+ description=None,
99
+ prompt_templates=self.prompt_templates
100
+ )
101
+ return new_agent
102
+
103
  GradioUI(AgentCloner(tools, prompt_templates)).launch()