Update app.py
Browse filestesting chess image question
app.py
CHANGED
@@ -26,7 +26,6 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
26 |
BASE_PYTHON_TOOLS["open"] = open
|
27 |
|
28 |
visit_webpage_tool = VisitWebpageTool()
|
29 |
-
|
30 |
final_answer = FinalAnswerTool()
|
31 |
|
32 |
model = LiteLLMModel(
|
@@ -48,6 +47,7 @@ class ImageDescriptionTool(Tool):
|
|
48 |
}
|
49 |
}
|
50 |
output_type = "string"
|
|
|
51 |
def __init__(self):
|
52 |
super().__init__()
|
53 |
self.client = genai.Client(api_key=os.environ.get("GEMINI_KEY"))
|
@@ -75,6 +75,7 @@ class AudioDescriptionTool(Tool):
|
|
75 |
}
|
76 |
}
|
77 |
output_type = "string"
|
|
|
78 |
def __init__(self):
|
79 |
super().__init__()
|
80 |
self.client = genai.Client(api_key=os.environ.get("GEMINI_KEY"))
|
@@ -149,11 +150,9 @@ audio_description_tool = AudioDescriptionTool()
|
|
149 |
class WikipediaSearchTool(Tool):
|
150 |
name = "wikipedia_search"
|
151 |
description = "Fetches a summary of a Wikipedia page based on a given search query (only one word or group of words)."
|
152 |
-
|
153 |
inputs = {
|
154 |
"query": {"type": "string", "description": "The search term for the Wikipedia page (only one word or group of words)."}
|
155 |
}
|
156 |
-
|
157 |
output_type = "string"
|
158 |
|
159 |
def __init__(self, lang="en"):
|
@@ -304,10 +303,10 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
304 |
# if item.get("task_id") == "4fc2f1ae-8625-45b5-ab34-ad4433bc21f8"
|
305 |
|
306 |
# chess image
|
307 |
-
|
308 |
|
309 |
# python code
|
310 |
-
if item.get("task_id") == "f918266a-b3e0-4914-865d-4faa564f1aef":
|
311 |
submitted_answer = agent(question_text)
|
312 |
else:
|
313 |
continue
|
|
|
26 |
BASE_PYTHON_TOOLS["open"] = open
|
27 |
|
28 |
visit_webpage_tool = VisitWebpageTool()
|
|
|
29 |
final_answer = FinalAnswerTool()
|
30 |
|
31 |
model = LiteLLMModel(
|
|
|
47 |
}
|
48 |
}
|
49 |
output_type = "string"
|
50 |
+
|
51 |
def __init__(self):
|
52 |
super().__init__()
|
53 |
self.client = genai.Client(api_key=os.environ.get("GEMINI_KEY"))
|
|
|
75 |
}
|
76 |
}
|
77 |
output_type = "string"
|
78 |
+
|
79 |
def __init__(self):
|
80 |
super().__init__()
|
81 |
self.client = genai.Client(api_key=os.environ.get("GEMINI_KEY"))
|
|
|
150 |
class WikipediaSearchTool(Tool):
|
151 |
name = "wikipedia_search"
|
152 |
description = "Fetches a summary of a Wikipedia page based on a given search query (only one word or group of words)."
|
|
|
153 |
inputs = {
|
154 |
"query": {"type": "string", "description": "The search term for the Wikipedia page (only one word or group of words)."}
|
155 |
}
|
|
|
156 |
output_type = "string"
|
157 |
|
158 |
def __init__(self, lang="en"):
|
|
|
303 |
# if item.get("task_id") == "4fc2f1ae-8625-45b5-ab34-ad4433bc21f8"
|
304 |
|
305 |
# chess image
|
306 |
+
if item.get("task_id") == "cca530fc-4052-43b2-b130-b30968d8aa44":
|
307 |
|
308 |
# python code
|
309 |
+
# if item.get("task_id") == "f918266a-b3e0-4914-865d-4faa564f1aef":
|
310 |
submitted_answer = agent(question_text)
|
311 |
else:
|
312 |
continue
|