Spaces:
Sleeping
Sleeping
Nienke Dekkema commited on
Commit ·
e4acbcb
1
Parent(s): a73f574
changed model
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
-
from smolagents import CodeAgent, WebSearchTool, InferenceClientModel, VisitWebpageTool, FinalAnswerTool, Tool, tool
|
| 7 |
from dotenv import load_dotenv
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
|
@@ -12,14 +12,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 12 |
|
| 13 |
# --- Basic Agent Definition ---
|
| 14 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 15 |
-
|
| 16 |
-
def __init__(self):
|
| 17 |
-
print("BasicAgent initialized.")
|
| 18 |
-
def __call__(self, question: str) -> str:
|
| 19 |
-
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 20 |
-
fixed_answer = "This is a default answer."
|
| 21 |
-
print(f"Agent returning fixed answer: {fixed_answer}")
|
| 22 |
-
return fixed_answer
|
| 23 |
|
| 24 |
|
| 25 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
@@ -47,8 +40,10 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 47 |
tools=[
|
| 48 |
WebSearchTool(),
|
| 49 |
VisitWebpageTool(),
|
|
|
|
| 50 |
],
|
| 51 |
-
model=
|
|
|
|
| 52 |
max_steps=10,
|
| 53 |
verbosity_level=2
|
| 54 |
)
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
from smolagents import CodeAgent, WebSearchTool, InferenceClientModel, VisitWebpageTool, FinalAnswerTool, Tool, tool, LiteLLMModel, DuckDuckGoSearchTool
|
| 7 |
from dotenv import load_dotenv
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
|
|
|
| 12 |
|
| 13 |
# --- Basic Agent Definition ---
|
| 14 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 15 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
|
|
| 40 |
tools=[
|
| 41 |
WebSearchTool(),
|
| 42 |
VisitWebpageTool(),
|
| 43 |
+
DuckDuckGoSearchTool()
|
| 44 |
],
|
| 45 |
+
model=LiteLLMModel(
|
| 46 |
+
model_id='ollama_chat/qwen2.5:14b'()),
|
| 47 |
max_steps=10,
|
| 48 |
verbosity_level=2
|
| 49 |
)
|