Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -999,6 +999,7 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
|
|
999 |
'units': unit
|
1000 |
}
|
1001 |
response = requests.get('https://api.openweathermap.org/data/2.5/weather', params=params)
|
|
|
1002 |
if response.status_code == 200:
|
1003 |
temperature = weather_data.get('main', {}).get('temp', 'TEMP_FROM_THE_JSON')
|
1004 |
forecast = [item.get('description', '') for item in weather_data.get('weather', [])]
|
@@ -1010,8 +1011,7 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
|
|
1010 |
"forecast": forecast
|
1011 |
}
|
1012 |
|
1013 |
-
return
|
1014 |
-
|
1015 |
else:
|
1016 |
return None
|
1017 |
|
|
|
999 |
'units': unit
|
1000 |
}
|
1001 |
response = requests.get('https://api.openweathermap.org/data/2.5/weather', params=params)
|
1002 |
+
print(response.status_code)
|
1003 |
if response.status_code == 200:
|
1004 |
temperature = weather_data.get('main', {}).get('temp', 'TEMP_FROM_THE_JSON')
|
1005 |
forecast = [item.get('description', '') for item in weather_data.get('weather', [])]
|
|
|
1011 |
"forecast": forecast
|
1012 |
}
|
1013 |
|
1014 |
+
return new_json
|
|
|
1015 |
else:
|
1016 |
return None
|
1017 |
|