Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,18 +58,6 @@ class BasicAgent:
|
|
| 58 |
|
| 59 |
print("BasicAgent initialized.")
|
| 60 |
api_key = os.getenv("HF_TOKEN")
|
| 61 |
-
llm = HuggingFaceInferenceAPI(
|
| 62 |
-
model_name="deepseek-ai/DeepSeek-R1-0528",
|
| 63 |
-
token=api_key,
|
| 64 |
-
provider="auto",
|
| 65 |
-
max_iterations=10,
|
| 66 |
-
max_execution_time=60
|
| 67 |
-
)
|
| 68 |
-
agent = AgentWorkflow.from_tools_or_functions(
|
| 69 |
-
[wikipedia_search_tool, youtube_transcript_tool, youtube_transcript_snippet_tool,
|
| 70 |
-
round_to_two_decimals_tool, text_inverter_tool, google_web_search_tool],
|
| 71 |
-
llm=llm
|
| 72 |
-
)
|
| 73 |
|
| 74 |
# END MY CODE
|
| 75 |
|
|
@@ -78,6 +66,20 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 78 |
Fetches all questions, runs the BasicAgent on them, submits all answers,
|
| 79 |
and displays the results.
|
| 80 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
# --- Determine HF Space Runtime URL and Repo URL ---
|
| 82 |
space_id = os.getenv("SPACE_ID") # Get the SPACE_ID for sending link to the code
|
| 83 |
|
|
|
|
| 58 |
|
| 59 |
print("BasicAgent initialized.")
|
| 60 |
api_key = os.getenv("HF_TOKEN")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
# END MY CODE
|
| 63 |
|
|
|
|
| 66 |
Fetches all questions, runs the BasicAgent on them, submits all answers,
|
| 67 |
and displays the results.
|
| 68 |
"""
|
| 69 |
+
|
| 70 |
+
llm = HuggingFaceInferenceAPI(
|
| 71 |
+
model_name="deepseek-ai/DeepSeek-R1-0528",
|
| 72 |
+
token=api_key,
|
| 73 |
+
provider="auto",
|
| 74 |
+
max_iterations=10,
|
| 75 |
+
max_execution_time=60
|
| 76 |
+
)
|
| 77 |
+
agent = AgentWorkflow.from_tools_or_functions(
|
| 78 |
+
[wikipedia_search_tool, youtube_transcript_tool, youtube_transcript_snippet_tool,
|
| 79 |
+
round_to_two_decimals_tool, text_inverter_tool, google_web_search_tool],
|
| 80 |
+
llm=llm
|
| 81 |
+
)
|
| 82 |
+
|
| 83 |
# --- Determine HF Space Runtime URL and Repo URL ---
|
| 84 |
space_id = os.getenv("SPACE_ID") # Get the SPACE_ID for sending link to the code
|
| 85 |
|