Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,16 +17,16 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 17 |
class CoderAgent:
|
| 18 |
"""Coder agent that is running the Qwen2.5 coder model and can generate and execute python code. It can import the pandas library for data analysis and manipulation."""
|
| 19 |
def __init__(self):
|
| 20 |
-
model
|
| 21 |
|
| 22 |
-
self.
|
| 23 |
-
model=model,
|
| 24 |
tools=[
|
| 25 |
#visit_webpage,
|
| 26 |
VisitWebpageTool(),
|
| 27 |
WebSearchTool(),
|
| 28 |
analyze_image
|
| 29 |
],
|
|
|
|
| 30 |
max_steps=10,
|
| 31 |
additional_authorized_imports=[
|
| 32 |
"geopandas",
|
|
@@ -52,7 +52,7 @@ class MasterAgent:
|
|
| 52 |
model=InferenceClientModel("deepseek-ai/DeepSeek-R1", max_tokens=8096),
|
| 53 |
|
| 54 |
try:
|
| 55 |
-
|
| 56 |
except Exception as e:
|
| 57 |
print(f"Error instantiating agent: {e}")
|
| 58 |
return f"Error initializing agent: {e}", None
|
|
@@ -71,7 +71,7 @@ class MasterAgent:
|
|
| 71 |
planning_interval=5,
|
| 72 |
max_steps=15,
|
| 73 |
prompt_templates=prompt_templates,
|
| 74 |
-
managed_agents=[
|
| 75 |
additional_authorized_imports=[
|
| 76 |
"geopandas",
|
| 77 |
"plotly",
|
|
|
|
| 17 |
class CoderAgent:
|
| 18 |
"""Coder agent that is running the Qwen2.5 coder model and can generate and execute python code. It can import the pandas library for data analysis and manipulation."""
|
| 19 |
def __init__(self):
|
| 20 |
+
model=InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct")
|
| 21 |
|
| 22 |
+
self.agent = CodeAgent(
|
|
|
|
| 23 |
tools=[
|
| 24 |
#visit_webpage,
|
| 25 |
VisitWebpageTool(),
|
| 26 |
WebSearchTool(),
|
| 27 |
analyze_image
|
| 28 |
],
|
| 29 |
+
model=model,
|
| 30 |
max_steps=10,
|
| 31 |
additional_authorized_imports=[
|
| 32 |
"geopandas",
|
|
|
|
| 52 |
model=InferenceClientModel("deepseek-ai/DeepSeek-R1", max_tokens=8096),
|
| 53 |
|
| 54 |
try:
|
| 55 |
+
coder = CoderAgent()
|
| 56 |
except Exception as e:
|
| 57 |
print(f"Error instantiating agent: {e}")
|
| 58 |
return f"Error initializing agent: {e}", None
|
|
|
|
| 71 |
planning_interval=5,
|
| 72 |
max_steps=15,
|
| 73 |
prompt_templates=prompt_templates,
|
| 74 |
+
managed_agents=[coder.agent],
|
| 75 |
additional_authorized_imports=[
|
| 76 |
"geopandas",
|
| 77 |
"plotly",
|