Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -65,8 +65,21 @@ if st.button("Generate Prediction"):
|
|
65 |
except json.JSONDecodeError:
|
66 |
continue
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
st.success("Response generated successfully!")
|
69 |
-
st.
|
70 |
except ValueError as ve:
|
71 |
st.error(f"Configuration error: {ve}")
|
72 |
except requests.exceptions.RequestException as re:
|
|
|
65 |
except json.JSONDecodeError:
|
66 |
continue
|
67 |
|
68 |
+
# Format the response for better readability
|
69 |
+
formatted_response = (
|
70 |
+
"<b>Impact of Climate Conditions on Sports Performance and Infrastructure:</b>\n"
|
71 |
+
f"- **Temperature**: {temperature}°C\n"
|
72 |
+
f"- **Humidity**: {humidity}%\n"
|
73 |
+
f"- **Air Quality Index**: {air_quality}\n"
|
74 |
+
f"- **Precipitation**: {precipitation}mm\n\n"
|
75 |
+
"<b>Findings:</b>\n"
|
76 |
+
f"{generated_text}\n\n"
|
77 |
+
"<b>Conclusion:</b>\n"
|
78 |
+
"Based on the predicted climate conditions, it's crucial to adapt sports performance strategies and infrastructure designs to ensure resilience and safety."
|
79 |
+
)
|
80 |
+
|
81 |
st.success("Response generated successfully!")
|
82 |
+
st.markdown(formatted_response, unsafe_allow_html=True)
|
83 |
except ValueError as ve:
|
84 |
st.error(f"Configuration error: {ve}")
|
85 |
except requests.exceptions.RequestException as re:
|