Spaces:
Sleeping
Sleeping
08.09.2025
Browse files- app.py +2 -2
- statefulagent.py +2 -2
app.py
CHANGED
|
@@ -32,8 +32,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 32 |
|
| 33 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 34 |
try:
|
| 35 |
-
|
| 36 |
-
|
| 37 |
except Exception as e:
|
| 38 |
print(f"Error instantiating agent: {e}")
|
| 39 |
return f"Error initializing agent: {e}", None
|
|
|
|
| 32 |
|
| 33 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 34 |
try:
|
| 35 |
+
agent = StatefulAgent(model_id='meta-llama/Llama-3.3-70B-Instruct')
|
| 36 |
+
# agent = StatefulAgent()
|
| 37 |
except Exception as e:
|
| 38 |
print(f"Error instantiating agent: {e}")
|
| 39 |
return f"Error initializing agent: {e}", None
|
statefulagent.py
CHANGED
|
@@ -3,7 +3,7 @@ from smolagents import CodeAgent, InferenceClientModel
|
|
| 3 |
from a_tools import search_tool, final_answer, image_generation_tool
|
| 4 |
|
| 5 |
class StatefulAgent:
|
| 6 |
-
def __init__(self, model_id = 'Qwen/Qwen2.5-Coder-32B-Instruct', context_len = 0):
|
| 7 |
a_model = InferenceClientModel(
|
| 8 |
model_id=model_id,
|
| 9 |
max_tokens=1024,
|
|
@@ -15,7 +15,7 @@ class StatefulAgent:
|
|
| 15 |
model=self.model,
|
| 16 |
stream_outputs=True,
|
| 17 |
code_block_tags="markdown",
|
| 18 |
-
use_structured_outputs_internally=
|
| 19 |
additional_authorized_imports=['requests', 'bs4','pandas','numpy',
|
| 20 |
'json','datetime','geopandas','shapely'])
|
| 21 |
self.context = []
|
|
|
|
| 3 |
from a_tools import search_tool, final_answer, image_generation_tool
|
| 4 |
|
| 5 |
class StatefulAgent:
|
| 6 |
+
def __init__(self, model_id = 'Qwen/Qwen2.5-Coder-32B-Instruct', context_len = 0, structured_code = False):
|
| 7 |
a_model = InferenceClientModel(
|
| 8 |
model_id=model_id,
|
| 9 |
max_tokens=1024,
|
|
|
|
| 15 |
model=self.model,
|
| 16 |
stream_outputs=True,
|
| 17 |
code_block_tags="markdown",
|
| 18 |
+
use_structured_outputs_internally=structured_code,
|
| 19 |
additional_authorized_imports=['requests', 'bs4','pandas','numpy',
|
| 20 |
'json','datetime','geopandas','shapely'])
|
| 21 |
self.context = []
|