Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,10 +10,6 @@ from audio_transcriber import AudioTranscriptionTool
|
|
| 10 |
from image_analyzer import ImageAnalysisTool
|
| 11 |
from wikipedia_searcher import WikipediaSearcher
|
| 12 |
|
| 13 |
-
#wikipedia_tool = WikipediaSearcher()
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
# GAIA scoring endpoint
|
| 18 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 19 |
|
|
@@ -37,25 +33,7 @@ Only return the exact answer."""
|
|
| 37 |
# Define agent tools
|
| 38 |
audio_tool = AudioTranscriptionTool()
|
| 39 |
image_tool = ImageAnalysisTool()
|
| 40 |
-
|
| 41 |
-
# name="wikipedia_search",
|
| 42 |
-
# description="Search for facts using Wikipedia.",
|
| 43 |
-
# input_schema={"query": {"type": "string", "description": "Search query"}},
|
| 44 |
-
# output_type="string",
|
| 45 |
-
# forward=lambda query: WikipediaSearcher().search(query)
|
| 46 |
-
#)
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
# Wrap WikipediaSearcher search method as a Tool
|
| 51 |
-
wikipedia_tool = Tool.from_function(
|
| 52 |
-
name="wikipedia_search",
|
| 53 |
-
description="Search for facts using Wikipedia.",
|
| 54 |
-
input_schema={"query": {"type": "string", "description": "Search query"}},
|
| 55 |
-
output_type="string",
|
| 56 |
-
forward=lambda query: WikipediaSearcher().search(query)
|
| 57 |
-
)
|
| 58 |
-
|
| 59 |
|
| 60 |
tools = [audio_tool, image_tool, wikipedia_tool]
|
| 61 |
|
|
@@ -66,7 +44,7 @@ class MyAgent(CodeAgent):
|
|
| 66 |
model="cognitivecomputations/dolphin-2.6-mixtral-8x7b",
|
| 67 |
api_key=os.getenv("HF_API_TOKEN", "").strip()
|
| 68 |
)
|
| 69 |
-
super().__init__(model=model, tools=tools)
|
| 70 |
|
| 71 |
# Evaluation + Submission function
|
| 72 |
def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
|
|
| 10 |
from image_analyzer import ImageAnalysisTool
|
| 11 |
from wikipedia_searcher import WikipediaSearcher
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# GAIA scoring endpoint
|
| 14 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 15 |
|
|
|
|
| 33 |
# Define agent tools
|
| 34 |
audio_tool = AudioTranscriptionTool()
|
| 35 |
image_tool = ImageAnalysisTool()
|
| 36 |
+
wikipedia_tool = WikipediaSearcher()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
tools = [audio_tool, image_tool, wikipedia_tool]
|
| 39 |
|
|
|
|
| 44 |
model="cognitivecomputations/dolphin-2.6-mixtral-8x7b",
|
| 45 |
api_key=os.getenv("HF_API_TOKEN", "").strip()
|
| 46 |
)
|
| 47 |
+
super().__init__(model=model, tools=tools, system_prompt=SYSTEM_PROMPT)
|
| 48 |
|
| 49 |
# Evaluation + Submission function
|
| 50 |
def run_and_submit_all(profile: gr.OAuthProfile | None):
|