Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 13 |
# --- Basic Agent Definition ---
|
| 14 |
class BasicAgent:
|
| 15 |
def __init__(self):
|
| 16 |
-
agent=Agent(
|
| 17 |
model=Nvidia(id="meta/llama-3.3-70b-instruct"),
|
| 18 |
instructions='''
|
| 19 |
## π Gaia Taskmaster: The Ultimate Agent Efficiency Prompt! π
|
|
@@ -43,7 +43,7 @@ class BasicAgent:
|
|
| 43 |
|
| 44 |
def __call__(self, question: str) -> str:
|
| 45 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 46 |
-
fixed_answer = agent.print_response(
|
| 47 |
question, stream=True
|
| 48 |
)
|
| 49 |
print(f"Agent returning fixed answer: {fixed_answer}")
|
|
@@ -110,7 +110,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 110 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 111 |
continue
|
| 112 |
try:
|
| 113 |
-
submitted_answer = agent(question_text)
|
| 114 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 115 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 116 |
except Exception as e:
|
|
|
|
| 13 |
# --- Basic Agent Definition ---
|
| 14 |
class BasicAgent:
|
| 15 |
def __init__(self):
|
| 16 |
+
self.agent=Agent(
|
| 17 |
model=Nvidia(id="meta/llama-3.3-70b-instruct"),
|
| 18 |
instructions='''
|
| 19 |
## π Gaia Taskmaster: The Ultimate Agent Efficiency Prompt! π
|
|
|
|
| 43 |
|
| 44 |
def __call__(self, question: str) -> str:
|
| 45 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 46 |
+
fixed_answer = self.agent.print_response(
|
| 47 |
question, stream=True
|
| 48 |
)
|
| 49 |
print(f"Agent returning fixed answer: {fixed_answer}")
|
|
|
|
| 110 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 111 |
continue
|
| 112 |
try:
|
| 113 |
+
submitted_answer = self.agent(question_text)
|
| 114 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 115 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 116 |
except Exception as e:
|