Spaces:
Runtime error
Runtime error
Commit
·
2799df0
1
Parent(s):
98904f1
Update app.py
Browse files
app.py
CHANGED
@@ -6,25 +6,23 @@ import requests
|
|
6 |
import hopsworks
|
7 |
import joblib
|
8 |
|
|
|
|
|
|
|
9 |
|
10 |
-
def
|
11 |
-
|
|
|
|
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
col_count=(3, "fixed"),
|
22 |
-
),
|
23 |
-
gr.Dropdown(["M", "F", "O"]),
|
24 |
-
],
|
25 |
-
"dataframe",
|
26 |
-
description="Enter gender as 'M', 'F', or 'O' for other.",
|
27 |
-
)
|
28 |
|
29 |
if __name__ == "__main__":
|
30 |
demo.launch()
|
|
|
6 |
import hopsworks
|
7 |
import joblib
|
8 |
|
9 |
+
project = hopsworks.login()
|
10 |
+
fs = project.get_feature_store()
|
11 |
+
dataset_api = project.get_dataset_api()
|
12 |
|
13 |
+
def update():
|
14 |
+
dataset_api.download("Resources/aqi_results.csv")
|
15 |
+
aqi = pd.read_csv('aqi_results.csv')
|
16 |
+
return aqi
|
17 |
|
18 |
+
with gr.Blocks() as demo:
|
19 |
+
gr.Markdown("Air Quality Index Prediction")
|
20 |
+
with gr.Row():
|
21 |
+
with gr.Column():
|
22 |
+
gr.Label("Predicted AQI in next 7 days in Singapore")
|
23 |
+
out = gr.Dataframe()
|
24 |
+
btn = gr.Button("Refresh")
|
25 |
+
btn.click(fn=update, inputs=None, outputs=out)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
if __name__ == "__main__":
|
28 |
demo.launch()
|