Spaces:
Sleeping
Sleeping
Jompatron
commited on
Commit
·
f37bb94
1
Parent(s):
ebf2e1b
button outside args
Browse files
app.py
CHANGED
|
@@ -116,17 +116,24 @@ def run_dashboard(forecast_days, hindcast_days):
|
|
| 116 |
return forecast_plot, hindcast_plot
|
| 117 |
|
| 118 |
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
return forecast_plot, hindcast_plot
|
| 117 |
|
| 118 |
|
| 119 |
+
with gr.Blocks() as iface:
|
| 120 |
+
|
| 121 |
+
gr.Markdown("# Air Quality Forecast Dashboard")
|
| 122 |
+
gr.Markdown("Forecast and hindcast PM2.5 using XGBoost + Hopsworks")
|
| 123 |
+
|
| 124 |
+
with gr.Row():
|
| 125 |
+
forecast_days = gr.Slider(3, 10, value=7, step=1, label="Forecast Days (future)")
|
| 126 |
+
hindcast_days = gr.Slider(3, 10, value=7, step=1, label="Hindcast Days (past)")
|
| 127 |
+
|
| 128 |
+
generate_button = gr.Button("Generate")
|
| 129 |
+
|
| 130 |
+
forecast_img = gr.Image(label="PM2.5 Forecast")
|
| 131 |
+
hindcast_img = gr.Image(label="PM2.5 Hindcast")
|
| 132 |
+
|
| 133 |
+
generate_button.click(
|
| 134 |
+
fn=run_dashboard,
|
| 135 |
+
inputs=[forecast_days, hindcast_days],
|
| 136 |
+
outputs=[forecast_img, hindcast_img]
|
| 137 |
+
)
|
| 138 |
+
|
| 139 |
+
iface.launch()
|