Spaces:
Sleeping
Sleeping
Update BasicAgent.py
Browse files- BasicAgent.py +8 -2
BasicAgent.py
CHANGED
|
@@ -13,11 +13,17 @@ from smolagents import (
|
|
| 13 |
class newAgent:
|
| 14 |
"""Adapts smolagents.CodeAgent to the HF course template API."""
|
| 15 |
def __init__(self):
|
| 16 |
-
model_id = "
|
| 17 |
hf_token = os.getenv("HUGGINGFACEHUB_API_TOKEN") # read real secret
|
| 18 |
if not hf_token:
|
| 19 |
raise RuntimeError("HUGGINGFACEHUB_API_TOKEN not set in Space secrets")
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
model = HfApiModel(model_id=model_id, token=hf_token)
|
| 22 |
|
| 23 |
# include FinalAnswerTool in tools so agent knows when to stop
|
|
|
|
| 13 |
class newAgent:
|
| 14 |
"""Adapts smolagents.CodeAgent to the HF course template API."""
|
| 15 |
def __init__(self):
|
| 16 |
+
model_id = "meta-llama/Meta-Llama-3-70B-Instruct" # correct repo name
|
| 17 |
hf_token = os.getenv("HUGGINGFACEHUB_API_TOKEN") # read real secret
|
| 18 |
if not hf_token:
|
| 19 |
raise RuntimeError("HUGGINGFACEHUB_API_TOKEN not set in Space secrets")
|
| 20 |
+
#*
|
| 21 |
+
system_prompt=(
|
| 22 |
+
"You are an agent that answers exam questions."
|
| 23 |
+
"Your answers should contain only what is asked for in the question, without any other content."
|
| 24 |
+
"Be exact and concise in your answers to get a good score on the exam questions."
|
| 25 |
+
)
|
| 26 |
+
#*
|
| 27 |
model = HfApiModel(model_id=model_id, token=hf_token)
|
| 28 |
|
| 29 |
# include FinalAnswerTool in tools so agent knows when to stop
|