Spaces:
Runtime error
Runtime error
ogegadavis254
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,8 @@ import requests
|
|
3 |
import os
|
4 |
import json
|
5 |
import pandas as pd
|
6 |
-
import folium # For map visualizations
|
7 |
-
from
|
8 |
|
9 |
# Function to call the Together AI model
|
10 |
def call_ai_model(all_message):
|
@@ -107,15 +107,12 @@ if st.button("Generate Prediction"):
|
|
107 |
st.markdown("**Predicted Impact on Performance and Infrastructure:**")
|
108 |
st.markdown(generated_text.strip())
|
109 |
|
110 |
-
#
|
111 |
map_center = [latitude, longitude]
|
112 |
sport_map = folium.Map(location=map_center, zoom_start=12)
|
113 |
-
|
114 |
-
folium.Marker(location=map_center, popup="User Location")
|
115 |
-
)
|
116 |
st.subheader("Geographical Visualization")
|
117 |
-
|
118 |
-
st.components.v1.html(sport_map._repr_html_(), height=600)
|
119 |
|
120 |
except ValueError as ve:
|
121 |
st.error(f"Configuration error: {ve}")
|
|
|
3 |
import os
|
4 |
import json
|
5 |
import pandas as pd
|
6 |
+
import folium # For map visualizations, though we'll generate a static map
|
7 |
+
from streamlit_folium import folium_static
|
8 |
|
9 |
# Function to call the Together AI model
|
10 |
def call_ai_model(all_message):
|
|
|
107 |
st.markdown("**Predicted Impact on Performance and Infrastructure:**")
|
108 |
st.markdown(generated_text.strip())
|
109 |
|
110 |
+
# Generate static map using Folium
|
111 |
map_center = [latitude, longitude]
|
112 |
sport_map = folium.Map(location=map_center, zoom_start=12)
|
113 |
+
folium.Marker(location=map_center, popup="User Location").add_to(sport_map)
|
|
|
|
|
114 |
st.subheader("Geographical Visualization")
|
115 |
+
folium_static(sport_map)
|
|
|
116 |
|
117 |
except ValueError as ve:
|
118 |
st.error(f"Configuration error: {ve}")
|