Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,23 +83,28 @@ agent = CodeAgent(
|
|
| 83 |
)
|
| 84 |
|
| 85 |
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
return f"The current local time in {timezone} is: {local_time}"
|
| 88 |
except Exception as e:
|
| 89 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 90 |
|
| 91 |
|
|
|
|
| 92 |
final_answer = FinalAnswerTool()
|
| 93 |
|
| 94 |
# 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:
|
| 95 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 96 |
|
| 97 |
-
model = HfApiModel(
|
| 98 |
-
max_tokens=2096,
|
| 99 |
-
temperature=0.5,
|
| 100 |
-
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 101 |
-
custom_role_conversions=None,
|
| 102 |
-
)
|
| 103 |
|
| 104 |
|
| 105 |
# Import tool from Hub
|
|
|
|
| 83 |
)
|
| 84 |
|
| 85 |
|
| 86 |
+
def get_local_time(timezone):
|
| 87 |
+
try:
|
| 88 |
+
from datetime import datetime
|
| 89 |
+
import pytz
|
| 90 |
+
local_time = datetime.now(pytz.timezone(timezone))
|
| 91 |
return f"The current local time in {timezone} is: {local_time}"
|
| 92 |
except Exception as e:
|
| 93 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 94 |
|
| 95 |
|
| 96 |
+
|
| 97 |
final_answer = FinalAnswerTool()
|
| 98 |
|
| 99 |
# 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:
|
| 100 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 101 |
|
| 102 |
+
# model = HfApiModel(
|
| 103 |
+
# max_tokens=2096,
|
| 104 |
+
# temperature=0.5,
|
| 105 |
+
# model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 106 |
+
# custom_role_conversions=None,
|
| 107 |
+
# )
|
| 108 |
|
| 109 |
|
| 110 |
# Import tool from Hub
|