Spaces:
Runtime error
Runtime error
Upload 2 files
Browse files- app.py +28 -0
- requirements.txt +3 -0
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import numpy as np
|
3 |
+
from PIL import Image
|
4 |
+
import requests
|
5 |
+
|
6 |
+
import hopsworks
|
7 |
+
import joblib
|
8 |
+
|
9 |
+
project = hopsworks.login(project="test42")
|
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()
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
hopsworks
|
2 |
+
joblib
|
3 |
+
scikit-learn
|