Spaces:
Sleeping
Sleeping
Update BasicAgent.py
Browse files- BasicAgent.py +4 -4
BasicAgent.py
CHANGED
|
@@ -19,16 +19,16 @@ from smolagents import (
|
|
| 19 |
class newAgent:
|
| 20 |
"""Adapts smolagents.CodeAgent to the HF course template API."""
|
| 21 |
def __init__(self):
|
| 22 |
-
model_id = "
|
| 23 |
hf_token = os.getenv("HUGGINGFACEHUB_API_TOKEN") # read real secret
|
| 24 |
if not hf_token:
|
| 25 |
raise RuntimeError("HUGGINGFACEHUB_API_TOKEN not set in Space secrets")
|
| 26 |
#*
|
| 27 |
system_prompt=(
|
| 28 |
"You are an agent that answers exam questions. "
|
| 29 |
-
"Your answers should contain
|
| 30 |
"Be exact and concise in your answers. "
|
| 31 |
-
"
|
| 32 |
"If asked for a list, provide ONLY the items requested separated by commas."
|
| 33 |
|
| 34 |
)
|
|
@@ -41,7 +41,7 @@ class newAgent:
|
|
| 41 |
tools=tools,
|
| 42 |
model=model,
|
| 43 |
add_base_tools=True,
|
| 44 |
-
max_steps=
|
| 45 |
)
|
| 46 |
|
| 47 |
def __call__(self, question: str) -> str:
|
|
|
|
| 19 |
class newAgent:
|
| 20 |
"""Adapts smolagents.CodeAgent to the HF course template API."""
|
| 21 |
def __init__(self):
|
| 22 |
+
model_id = "Qwen/Qwen2.5-Coder-32B-Instruct" # correct repo name
|
| 23 |
hf_token = os.getenv("HUGGINGFACEHUB_API_TOKEN") # read real secret
|
| 24 |
if not hf_token:
|
| 25 |
raise RuntimeError("HUGGINGFACEHUB_API_TOKEN not set in Space secrets")
|
| 26 |
#*
|
| 27 |
system_prompt=(
|
| 28 |
"You are an agent that answers exam questions. "
|
| 29 |
+
"Your answers should contain exactly what is asked for in the question. "
|
| 30 |
"Be exact and concise in your answers. "
|
| 31 |
+
"Do not add explanations or additional information. "
|
| 32 |
"If asked for a list, provide ONLY the items requested separated by commas."
|
| 33 |
|
| 34 |
)
|
|
|
|
| 41 |
tools=tools,
|
| 42 |
model=model,
|
| 43 |
add_base_tools=True,
|
| 44 |
+
max_steps=3 # limit reasoning time
|
| 45 |
)
|
| 46 |
|
| 47 |
def __call__(self, question: str) -> str:
|