Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -41,20 +41,20 @@ def animal_image_generation_tool(animal_name: str) -> str:
|
|
41 |
return f"Error during image generation: {str(e)}"
|
42 |
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
|
59 |
|
60 |
# Initializing the tool for the final response
|
@@ -65,10 +65,10 @@ final_answer = FinalAnswerTool()
|
|
65 |
|
66 |
# configuring the model
|
67 |
model = HfApiModel(
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
)
|
73 |
|
74 |
|
|
|
41 |
return f"Error during image generation: {str(e)}"
|
42 |
|
43 |
|
44 |
+
@tool
|
45 |
+
def get_current_time_in_timezone(timezone: str) -> str:
|
46 |
+
"""A tool that fetches the current local time in a specified timezone.
|
47 |
+
Args:
|
48 |
+
timezone: A string representing a valid timezone (e.g., 'America/New_York').
|
49 |
+
"""
|
50 |
+
try:
|
51 |
+
# Create timezone object
|
52 |
+
tz = pytz.timezone(timezone)
|
53 |
+
# Get current time in that timezone
|
54 |
+
local_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
|
55 |
+
return f"The current local time in {timezone} is: {local_time}"
|
56 |
+
except Exception as e:
|
57 |
+
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
58 |
|
59 |
|
60 |
# Initializing the tool for the final response
|
|
|
65 |
|
66 |
# configuring the model
|
67 |
model = HfApiModel(
|
68 |
+
max_tokens=2096,
|
69 |
+
temperature=0.5,
|
70 |
+
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
71 |
+
custom_role_conversions=None,
|
72 |
)
|
73 |
|
74 |
|