Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,6 @@ import requests
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
-
import os
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
|
@@ -18,7 +17,7 @@ def wikipedia_summary_tool(query:str)-> str: #it's import to specify the return
|
|
| 18 |
"""
|
| 19 |
try:
|
| 20 |
params = {
|
| 21 |
-
"action": "
|
| 22 |
"format": "json",
|
| 23 |
"titles": query,
|
| 24 |
"prop": "extracts",
|
|
@@ -68,8 +67,6 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 68 |
except Exception as e:
|
| 69 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 70 |
|
| 71 |
-
hf_api_key = os.getenv("HF_TOKEN")
|
| 72 |
-
|
| 73 |
final_answer = FinalAnswerTool()
|
| 74 |
|
| 75 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
|
@@ -80,7 +77,6 @@ max_tokens=2096,
|
|
| 80 |
temperature=0.5,
|
| 81 |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 82 |
custom_role_conversions=None,
|
| 83 |
-
api_key=hf_api_key,
|
| 84 |
)
|
| 85 |
|
| 86 |
|
|
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
|
|
|
| 17 |
"""
|
| 18 |
try:
|
| 19 |
params = {
|
| 20 |
+
"action": "query",
|
| 21 |
"format": "json",
|
| 22 |
"titles": query,
|
| 23 |
"prop": "extracts",
|
|
|
|
| 67 |
except Exception as e:
|
| 68 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 69 |
|
|
|
|
|
|
|
| 70 |
final_answer = FinalAnswerTool()
|
| 71 |
|
| 72 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
|
|
|
| 77 |
temperature=0.5,
|
| 78 |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 79 |
custom_role_conversions=None,
|
|
|
|
| 80 |
)
|
| 81 |
|
| 82 |
|