Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,7 +64,8 @@ def load_model_and_predict(prediction_type, time_interval, input_data):
|
|
| 64 |
|
| 65 |
# Save map as HTML and convert to base64
|
| 66 |
map_html = BytesIO()
|
| 67 |
-
map_.save(map_html
|
|
|
|
| 68 |
map_base64 = base64.b64encode(map_html.getvalue()).decode("utf-8")
|
| 69 |
|
| 70 |
return f"Predicted Path after {time_interval}: Latitude: {lat}, Longitude: {lon}", f'<iframe src="data:text/html;base64,{map_base64}" width="100%" height="400"></iframe>'
|
|
@@ -140,4 +141,4 @@ with gr.Blocks() as cyclone_predictor:
|
|
| 140 |
outputs=[prediction_output, map_output]
|
| 141 |
)
|
| 142 |
|
| 143 |
-
cyclone_predictor.launch()
|
|
|
|
| 64 |
|
| 65 |
# Save map as HTML and convert to base64
|
| 66 |
map_html = BytesIO()
|
| 67 |
+
map_.save(map_html) # removed 'format' argument
|
| 68 |
+
map_html.seek(0)
|
| 69 |
map_base64 = base64.b64encode(map_html.getvalue()).decode("utf-8")
|
| 70 |
|
| 71 |
return f"Predicted Path after {time_interval}: Latitude: {lat}, Longitude: {lon}", f'<iframe src="data:text/html;base64,{map_base64}" width="100%" height="400"></iframe>'
|
|
|
|
| 141 |
outputs=[prediction_output, map_output]
|
| 142 |
)
|
| 143 |
|
| 144 |
+
cyclone_predictor.launch()
|