Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,8 +3,6 @@ import requests
|
|
| 3 |
import os
|
| 4 |
import json
|
| 5 |
import pandas as pd
|
| 6 |
-
import folium
|
| 7 |
-
from streamlit_folium import folium_static
|
| 8 |
import matplotlib.pyplot as plt
|
| 9 |
|
| 10 |
# Function to call the Together AI model
|
|
@@ -59,11 +57,11 @@ if st.button("Generate Prediction"):
|
|
| 59 |
f"Temperature {temperature}°C, Humidity {humidity}%, Wind Speed {wind_speed} km/h, UV Index {uv_index}, "
|
| 60 |
f"Air Quality Index {air_quality_index}, Precipitation {precipitation} mm, Atmospheric Pressure {atmospheric_pressure} hPa. "
|
| 61 |
f"Location: Latitude {latitude}, Longitude {longitude}."
|
| 62 |
-
f"After
|
| 63 |
)
|
| 64 |
|
| 65 |
try:
|
| 66 |
-
with st.spinner("Generating
|
| 67 |
response = call_ai_model(all_message)
|
| 68 |
|
| 69 |
generated_text = ""
|
|
@@ -105,13 +103,6 @@ if st.button("Generate Prediction"):
|
|
| 105 |
ax.set_title('Climate Conditions Impact')
|
| 106 |
st.pyplot(fig)
|
| 107 |
|
| 108 |
-
# Generate static map using Folium
|
| 109 |
-
map_center = [latitude, longitude]
|
| 110 |
-
sport_map = folium.Map(location=map_center, zoom_start=12)
|
| 111 |
-
folium.Marker(location=map_center, popup="User Location").add_to(sport_map)
|
| 112 |
-
st.subheader("Geographical Visualization")
|
| 113 |
-
folium_static(sport_map)
|
| 114 |
-
|
| 115 |
except ValueError as ve:
|
| 116 |
st.error(f"Configuration error: {ve}")
|
| 117 |
except requests.exceptions.RequestException as re:
|
|
|
|
| 3 |
import os
|
| 4 |
import json
|
| 5 |
import pandas as pd
|
|
|
|
|
|
|
| 6 |
import matplotlib.pyplot as plt
|
| 7 |
|
| 8 |
# Function to call the Together AI model
|
|
|
|
| 57 |
f"Temperature {temperature}°C, Humidity {humidity}%, Wind Speed {wind_speed} km/h, UV Index {uv_index}, "
|
| 58 |
f"Air Quality Index {air_quality_index}, Precipitation {precipitation} mm, Atmospheric Pressure {atmospheric_pressure} hPa. "
|
| 59 |
f"Location: Latitude {latitude}, Longitude {longitude}."
|
| 60 |
+
f"After analyzing that I want you to visualize the data in the best way possible, might be in a table, using a chart or any other way so that it could be easy to understand"
|
| 61 |
)
|
| 62 |
|
| 63 |
try:
|
| 64 |
+
with st.spinner("Analyzing climate conditions... Generating predictions... Preparing visualizations..."):
|
| 65 |
response = call_ai_model(all_message)
|
| 66 |
|
| 67 |
generated_text = ""
|
|
|
|
| 103 |
ax.set_title('Climate Conditions Impact')
|
| 104 |
st.pyplot(fig)
|
| 105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
except ValueError as ve:
|
| 107 |
st.error(f"Configuration error: {ve}")
|
| 108 |
except requests.exceptions.RequestException as re:
|