Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -135,17 +135,25 @@ def fetch_weather_trend(lat, lon):
|
|
| 135 |
return 'same'
|
| 136 |
|
| 137 |
def generate_recommendations(original_severity, weather_trend):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
projected = task_rules[original_severity][weather_trend]
|
| 139 |
rec = recommendations[projected]
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
def pipeline(image):
|
| 151 |
if image is None:
|
|
|
|
| 135 |
return 'same'
|
| 136 |
|
| 137 |
def generate_recommendations(original_severity, weather_trend):
|
| 138 |
+
"""
|
| 139 |
+
Generate management recommendations based on original severity and weather trend.
|
| 140 |
+
Returns a formatted markdown string.
|
| 141 |
+
"""
|
| 142 |
projected = task_rules[original_severity][weather_trend]
|
| 143 |
rec = recommendations[projected]
|
| 144 |
+
|
| 145 |
+
# Build the output string using f-strings and implicit concatenation
|
| 146 |
+
return (
|
| 147 |
+
f"**Original Severity:** {original_severity.title()}\n"
|
| 148 |
+
f"**Weather Trend:** {weather_trend.title()}\n"
|
| 149 |
+
f"**Projected Severity:** {projected.title()}\n\n"
|
| 150 |
+
"### Management Recommendations:\n"
|
| 151 |
+
f"**Immediate:** {rec['immediate']}\n\n"
|
| 152 |
+
f"**Evacuation:** {rec['evacuation']}\n\n"
|
| 153 |
+
f"**Containment:** {rec['containment']}\n\n"
|
| 154 |
+
f"**Prevention:** {rec['prevention']}\n\n"
|
| 155 |
+
f"**Education:** {rec['education']}"
|
| 156 |
+
)
|
| 157 |
|
| 158 |
def pipeline(image):
|
| 159 |
if image is None:
|