Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ search_tool = DuckDuckGoSearchTool()
|
|
27 |
|
28 |
# --- System Prompt for ReACT + Scratchpad + Auto-Retry ---
|
29 |
|
30 |
-
|
31 |
You are a ReACT agent with scratchpad memory and a retry mechanism.
|
32 |
|
33 |
For every question:
|
@@ -69,7 +69,7 @@ FINAL ANSWER: grapes, apples
|
|
69 |
|
70 |
smart_agent = CodeAgent(
|
71 |
tools=[search_tool, summarize_query],
|
72 |
-
model=HfApiModel(
|
73 |
)
|
74 |
|
75 |
# --- Integrate into Gradio App ---
|
@@ -104,7 +104,6 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
104 |
return f"Error initializing agent: {e}", None
|
105 |
|
106 |
agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
|
107 |
-
print(f"Agent code URL: {agent_code}")
|
108 |
|
109 |
# Fetch questions
|
110 |
try:
|
|
|
27 |
|
28 |
# --- System Prompt for ReACT + Scratchpad + Auto-Retry ---
|
29 |
|
30 |
+
system_message = """
|
31 |
You are a ReACT agent with scratchpad memory and a retry mechanism.
|
32 |
|
33 |
For every question:
|
|
|
69 |
|
70 |
smart_agent = CodeAgent(
|
71 |
tools=[search_tool, summarize_query],
|
72 |
+
model=HfApiModel(system_message=system_message) # <-- key fix here
|
73 |
)
|
74 |
|
75 |
# --- Integrate into Gradio App ---
|
|
|
104 |
return f"Error initializing agent: {e}", None
|
105 |
|
106 |
agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
|
|
|
107 |
|
108 |
# Fetch questions
|
109 |
try:
|