Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -14,23 +14,28 @@ from functions import *
|
|
14 |
project = hopsworks.login()
|
15 |
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
20 |
|
21 |
-
#X = X.drop(columns=["date"]).fillna(0)
|
22 |
|
23 |
-
X = X.drop(X.columns[0],axis=1)
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
|
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
model = joblib.load(model_dir + "/model.pkl")
|
31 |
-
|
32 |
-
preds = model.predict(X)
|
33 |
-
print(model.predict(X)[:7])
|
34 |
|
35 |
|
36 |
demo = gr.Interface(fn=air_quality, title="Air quality predictor",
|
|
|
14 |
project = hopsworks.login()
|
15 |
|
16 |
|
17 |
+
def air_quality():
|
18 |
+
start_date = datetime.now() - timedelta(days=1)
|
19 |
+
start_time = int(start_date.timestamp()) * 1000
|
20 |
+
X = pd.read_csv('x.csv')
|
21 |
|
22 |
+
#X = X.drop(columns=["date"]).fillna(0)
|
23 |
|
24 |
+
X = X.drop(X.columns[0],axis=1)
|
25 |
|
26 |
+
mr = project.get_model_registry()
|
27 |
+
model = mr.get_model("gradient_boost_paris_model", version=1)
|
28 |
+
model_dir = model.download()
|
29 |
+
model = joblib.load(model_dir + "/model.pkl")
|
30 |
+
|
31 |
+
preds = model.predict(X)
|
32 |
+
print(model.predict(X)[:7])
|
33 |
|
34 |
+
return preds
|
35 |
|
36 |
+
|
37 |
+
|
38 |
+
|
|
|
|
|
|
|
|
|
39 |
|
40 |
|
41 |
demo = gr.Interface(fn=air_quality, title="Air quality predictor",
|