Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
@@ -18,7 +18,9 @@ def display_weather(temperature:str)-> str: #it's import to specify the return t
|
|
| 18 |
"""
|
| 19 |
is_fahrenheit = temperature.split("°F")[0]
|
| 20 |
if is_fahrenheit == "°F":
|
|
|
|
| 21 |
temperature = (temperature - 32) * 5/9
|
|
|
|
| 22 |
|
| 23 |
return temperature
|
| 24 |
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
|
|
| 18 |
"""
|
| 19 |
is_fahrenheit = temperature.split("°F")[0]
|
| 20 |
if is_fahrenheit == "°F":
|
| 21 |
+
temperature = float(temperature)
|
| 22 |
temperature = (temperature - 32) * 5/9
|
| 23 |
+
temperature = str(temperature) + is_fahrenheit[1]
|
| 24 |
|
| 25 |
return temperature
|
| 26 |
|