Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,6 +49,18 @@ class BasicAgent:
|
|
| 49 |
return self.run(question)
|
| 50 |
#return self.agent.run(question)
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 54 |
"""
|
|
@@ -125,7 +137,6 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 125 |
#3A
|
| 126 |
|
| 127 |
async def run_all_questions(questions_data):
|
| 128 |
-
agent = BasicAgent()
|
| 129 |
answers_payload = []
|
| 130 |
for item in questions_data:
|
| 131 |
task_id = item.get("task_id")
|
|
|
|
| 49 |
return self.run(question)
|
| 50 |
#return self.agent.run(question)
|
| 51 |
|
| 52 |
+
api_key = os.getenv("HF_TOKEN")
|
| 53 |
+
llm = HuggingFaceInferenceAPI(
|
| 54 |
+
model_name="deepseek-ai/DeepSeek-R1-0528",
|
| 55 |
+
token=api_key,
|
| 56 |
+
provider="auto",
|
| 57 |
+
max_iterations=10
|
| 58 |
+
)
|
| 59 |
+
agent = AgentWorkflow.from_tools_or_functions(
|
| 60 |
+
[wikipedia_search_tool, youtube_transcript_tool, youtube_transcript_snippet_tool,
|
| 61 |
+
round_to_two_decimals_tool, text_inverter_tool, google_web_search_tool],
|
| 62 |
+
llm=llm
|
| 63 |
+
)
|
| 64 |
|
| 65 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 66 |
"""
|
|
|
|
| 137 |
#3A
|
| 138 |
|
| 139 |
async def run_all_questions(questions_data):
|
|
|
|
| 140 |
answers_payload = []
|
| 141 |
for item in questions_data:
|
| 142 |
task_id = item.get("task_id")
|