Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import re
|
|
| 3 |
import requests
|
| 4 |
import gradio as gr
|
| 5 |
import pandas as pd
|
| 6 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool,
|
| 7 |
|
| 8 |
# --- Constants ---
|
| 9 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
@@ -120,11 +120,10 @@ class BasicAgent:
|
|
| 120 |
def __init__(self):
|
| 121 |
print("Initializing HuggingFace agent...")
|
| 122 |
|
| 123 |
-
# Use
|
| 124 |
-
self.model =
|
| 125 |
-
model_id="Qwen/Qwen2.5-
|
| 126 |
token=os.environ.get("HF_TOKEN"),
|
| 127 |
-
timeout=60,
|
| 128 |
)
|
| 129 |
|
| 130 |
self.agent = CodeAgent(
|
|
@@ -137,7 +136,7 @@ class BasicAgent:
|
|
| 137 |
get_task_file,
|
| 138 |
reverse_text,
|
| 139 |
],
|
| 140 |
-
max_steps=5,
|
| 141 |
verbosity_level=2,
|
| 142 |
)
|
| 143 |
print("Agent ready!")
|
|
@@ -248,7 +247,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 248 |
|
| 249 |
with gr.Blocks() as demo:
|
| 250 |
gr.Markdown("# 🎯 GAIA Agent - Unit 4")
|
| 251 |
-
gr.Markdown("Using **HuggingFace** + **Qwen
|
| 252 |
|
| 253 |
gr.LoginButton()
|
| 254 |
run_btn = gr.Button("🚀 Run Evaluation", variant="primary")
|
|
|
|
| 3 |
import requests
|
| 4 |
import gradio as gr
|
| 5 |
import pandas as pd
|
| 6 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, tool, VisitWebpageTool
|
| 7 |
|
| 8 |
# --- Constants ---
|
| 9 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
|
|
| 120 |
def __init__(self):
|
| 121 |
print("Initializing HuggingFace agent...")
|
| 122 |
|
| 123 |
+
# Use HfApiModel with a FREE model
|
| 124 |
+
self.model = HfApiModel(
|
| 125 |
+
model_id="Qwen/Qwen2.5-72B-Instruct", # This one should be free
|
| 126 |
token=os.environ.get("HF_TOKEN"),
|
|
|
|
| 127 |
)
|
| 128 |
|
| 129 |
self.agent = CodeAgent(
|
|
|
|
| 136 |
get_task_file,
|
| 137 |
reverse_text,
|
| 138 |
],
|
| 139 |
+
max_steps=5,
|
| 140 |
verbosity_level=2,
|
| 141 |
)
|
| 142 |
print("Agent ready!")
|
|
|
|
| 247 |
|
| 248 |
with gr.Blocks() as demo:
|
| 249 |
gr.Markdown("# 🎯 GAIA Agent - Unit 4")
|
| 250 |
+
gr.Markdown("Using **HuggingFace** + **Qwen 72B**")
|
| 251 |
|
| 252 |
gr.LoginButton()
|
| 253 |
run_btn = gr.Button("🚀 Run Evaluation", variant="primary")
|