ayberkuckun commited on
Commit
8d5517c
1 Parent(s): 0f33595

update button

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -2,7 +2,9 @@ import gradio as gr
2
  import hopsworks
3
 
4
  project = hopsworks.login()
 
5
  dataset_api = project.get_dataset_api()
 
6
  dataset_api.download("Resources/aqi/images/df_next_7_days.png", overwrite=True)
7
 
8
 
@@ -11,13 +13,10 @@ def update():
11
  return "df_next_7_days.png"
12
 
13
 
14
- iface = gr.Interface(
15
- fn=update,
16
- inputs=gr.Button("Update Predictions"),
17
- outputs=[gr.Image("df_next_7_days.png")],
18
- title="Paris - AQI Prediction",
19
- description="Air Quality Index Prediction using weather forecast for the next 7 days.",
20
- allow_flagging="never"
21
- )
22
 
23
- iface.launch()
 
2
  import hopsworks
3
 
4
  project = hopsworks.login()
5
+
6
  dataset_api = project.get_dataset_api()
7
+
8
  dataset_api.download("Resources/aqi/images/df_next_7_days.png", overwrite=True)
9
 
10
 
 
13
  return "df_next_7_days.png"
14
 
15
 
16
+ with gr.Blocks() as demo:
17
+ with gr.Row():
18
+ with gr.Column():
19
+ gr.Label("Paris - AQI Predictions")
20
+ gr.Button("Update Predictions").click(update, None, gr.Image("df_next_7_days.png"))
 
 
 
21
 
22
+ demo.launch()