Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
| 15 |
# (Keep Constants as is)
|
| 16 |
# --- Constants ---
|
| 17 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 18 |
-
|
| 19 |
# --- Basic Agent Definition ---
|
| 20 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 21 |
class BasicAgent:
|
|
@@ -30,11 +30,12 @@ class BasicAgent:
|
|
| 30 |
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-32B-Instruct")
|
| 31 |
|
| 32 |
agent = CodeAgent(tools=[WebSearchTool()], model=model, stream_outputs=True)
|
| 33 |
-
|
|
|
|
| 34 |
|
| 35 |
print(f"Agent returning fixed answer: {custom_answer}")
|
| 36 |
|
| 37 |
-
|
| 38 |
return fixed_answer
|
| 39 |
|
| 40 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
|
|
| 15 |
# (Keep Constants as is)
|
| 16 |
# --- Constants ---
|
| 17 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 18 |
+
first_question = True
|
| 19 |
# --- Basic Agent Definition ---
|
| 20 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 21 |
class BasicAgent:
|
|
|
|
| 30 |
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-32B-Instruct")
|
| 31 |
|
| 32 |
agent = CodeAgent(tools=[WebSearchTool()], model=model, stream_outputs=True)
|
| 33 |
+
if first_question:
|
| 34 |
+
custom_answer = agent.run("How many seconds would it take for a leopard at full speed to run through Pont des Arts?")
|
| 35 |
|
| 36 |
print(f"Agent returning fixed answer: {custom_answer}")
|
| 37 |
|
| 38 |
+
first_question = False
|
| 39 |
return fixed_answer
|
| 40 |
|
| 41 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|