Spaces:
Runtime error
Runtime error
Orangefish
commited on
Commit
•
e6d7d2c
1
Parent(s):
303fdf6
Update app.py
Browse files
app.py
CHANGED
@@ -20,9 +20,9 @@ from functions import get_weather_data, get_weather_df, get_weather_json_quick
|
|
20 |
|
21 |
def greet(name):
|
22 |
X = pd.DataFrame()
|
23 |
-
for i in range(
|
24 |
# Get, rename column and rescalef
|
25 |
-
next_day_date = datetime.today()
|
26 |
next_day = next_day_date.strftime ('%Y-%m-%d')
|
27 |
json = get_weather_json_quick(next_day)
|
28 |
temp = get_weather_data(json)
|
@@ -95,16 +95,6 @@ def greet(name):
|
|
95 |
# In[46]:
|
96 |
|
97 |
|
98 |
-
project = hopsworks.login()
|
99 |
-
mr = project.get_model_registry()
|
100 |
-
|
101 |
-
|
102 |
-
# In[50]:
|
103 |
-
|
104 |
-
|
105 |
-
model = mr.get_model("gradient_boost_model",version = 4)
|
106 |
-
model_dir = model.download()
|
107 |
-
model = joblib.load(model_dir + "/model.pkl")
|
108 |
preds = model.predict(X)
|
109 |
|
110 |
|
@@ -129,6 +119,17 @@ def greet(name):
|
|
129 |
# In[ ]:
|
130 |
|
131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
133 |
|
134 |
|
|
|
20 |
|
21 |
def greet(name):
|
22 |
X = pd.DataFrame()
|
23 |
+
for i in range(14):
|
24 |
# Get, rename column and rescalef
|
25 |
+
next_day_date = datetime.today() - timedelta(days=i)
|
26 |
next_day = next_day_date.strftime ('%Y-%m-%d')
|
27 |
json = get_weather_json_quick(next_day)
|
28 |
temp = get_weather_data(json)
|
|
|
95 |
# In[46]:
|
96 |
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
preds = model.predict(X)
|
99 |
|
100 |
|
|
|
119 |
# In[ ]:
|
120 |
|
121 |
|
122 |
+
project = hopsworks.login()
|
123 |
+
mr = project.get_model_registry()
|
124 |
+
|
125 |
+
|
126 |
+
# In[50]:
|
127 |
+
|
128 |
+
|
129 |
+
model = mr.get_model("gradient_boost_model",version = 4)
|
130 |
+
model_dir = model.download()
|
131 |
+
model = joblib.load(model_dir + "/model.pkl")
|
132 |
+
|
133 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
134 |
|
135 |
|