Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,12 +21,12 @@ def air_quality(city):
|
|
21 |
weather_data = get_weather_df([get_weather_data((datetime.now() + timedelta(days=i)).strftime("%Y-%m-%d"))])
|
22 |
weather_df = weather_df.append(weather_data)
|
23 |
|
24 |
-
weather_df = weather_df.drop(columns=["precipprob", "uvindex", "date","city","conditions"]).fillna(0)
|
25 |
|
26 |
mr = project.get_model_registry()
|
27 |
-
model = mr.get_model("
|
28 |
model_dir = model.download()
|
29 |
-
model = joblib.load(model_dir + "/
|
30 |
|
31 |
preds = model.predict(weather_df)
|
32 |
|
@@ -39,7 +39,7 @@ def air_quality(city):
|
|
39 |
|
40 |
|
41 |
demo = gr.Interface(fn=air_quality, title="Air quality predictor",
|
42 |
-
description="Input a value to get next weeks AQI prediction for
|
43 |
|
44 |
|
45 |
|
|
|
21 |
weather_data = get_weather_df([get_weather_data((datetime.now() + timedelta(days=i)).strftime("%Y-%m-%d"))])
|
22 |
weather_df = weather_df.append(weather_data)
|
23 |
|
24 |
+
weather_df = weather_df.drop(columns=["feelslikemin", "feelslikemax", "precipprob", "snowdepth", "uvindex", "date","city","conditions"]).fillna(0)
|
25 |
|
26 |
mr = project.get_model_registry()
|
27 |
+
model = mr.get_model("hel_gradient_boost_model", version=1)
|
28 |
model_dir = model.download()
|
29 |
+
model = joblib.load(model_dir + "/hel_model.pkl")
|
30 |
|
31 |
preds = model.predict(weather_df)
|
32 |
|
|
|
39 |
|
40 |
|
41 |
demo = gr.Interface(fn=air_quality, title="Air quality predictor",
|
42 |
+
description="Input a value to get next weeks AQI prediction for Helsinki", inputs="text", outputs="text")
|
43 |
|
44 |
|
45 |
|