ogegadavis254 commited on
Commit
bb763aa
·
verified ·
1 Parent(s): f689a87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
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 folium.plugins import MarkerCluster
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
- # Create a map with the user's location
111
  map_center = [latitude, longitude]
112
  sport_map = folium.Map(location=map_center, zoom_start=12)
113
- MarkerCluster().add_to(sport_map).add_child(
114
- folium.Marker(location=map_center, popup="User Location")
115
- )
116
  st.subheader("Geographical Visualization")
117
- st.write("Map showing the location's impact on sports performance and infrastructure.")
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}")