ogegadavis254 commited on
Commit
516b5b4
·
verified ·
1 Parent(s): 8f7d62b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -4,7 +4,7 @@ import os
4
  import json
5
  import pandas as pd
6
  import matplotlib.pyplot as plt
7
- import numpy as np
8
 
9
  # Function to call the Together API with the provided model
10
  def call_ai_model(all_message):
@@ -96,22 +96,19 @@ if st.button("Generate Prediction"):
96
  st.markdown(f"**Impact Summary:** {generated_text.strip()}")
97
  st.markdown("**Conclusion:** Tailoring strategies based on these climate conditions can significantly enhance performance and infrastructure resilience.")
98
 
99
- # Data Visualization
100
- st.subheader("Climate Condition Impacts Visualization")
101
- # Example: Displaying data in a table
102
  data = {
103
  'Condition': ['Temperature', 'Humidity', 'Wind Speed', 'UV Index', 'Air Quality Index', 'Precipitation', 'Atmospheric Pressure'],
104
  'Value': [temperature, humidity, wind_speed, uv_index, air_quality_index, precipitation, atmospheric_pressure]
105
  }
106
  df = pd.DataFrame(data)
 
107
  st.table(df)
108
 
109
- # Plotting a bar chart for climate variables
110
- fig, ax = plt.subplots()
111
- ax.bar(data['Condition'], data['Value'], color=['blue', 'green', 'orange', 'red', 'purple', 'gray', 'cyan'])
112
- ax.set_ylabel('Value')
113
- ax.set_title('Climate Condition Impacts')
114
- st.pyplot(fig)
115
 
116
  except ValueError as ve:
117
  st.error(f"Configuration error: {ve}")
 
4
  import json
5
  import pandas as pd
6
  import matplotlib.pyplot as plt
7
+ from PIL import Image
8
 
9
  # Function to call the Together API with the provided model
10
  def call_ai_model(all_message):
 
96
  st.markdown(f"**Impact Summary:** {generated_text.strip()}")
97
  st.markdown("**Conclusion:** Tailoring strategies based on these climate conditions can significantly enhance performance and infrastructure resilience.")
98
 
99
+ # Displaying a table of input data
 
 
100
  data = {
101
  'Condition': ['Temperature', 'Humidity', 'Wind Speed', 'UV Index', 'Air Quality Index', 'Precipitation', 'Atmospheric Pressure'],
102
  'Value': [temperature, humidity, wind_speed, uv_index, air_quality_index, precipitation, atmospheric_pressure]
103
  }
104
  df = pd.DataFrame(data)
105
+ st.subheader("Input Data Overview")
106
  st.table(df)
107
 
108
+ # Display an infographic
109
+ infographics_path = 'path_to_your_infographic_image.jpg' # Replace with your image path
110
+ infographic = Image.open(infographics_path)
111
+ st.image(infographic, caption='Climate Impact Infographic', use_column_width=True)
 
 
112
 
113
  except ValueError as ve:
114
  st.error(f"Configuration error: {ve}")