Spaces:
Runtime error
Runtime error
Commit
•
9d7e90c
1
Parent(s):
82d1a2a
Update app.py
Browse files
app.py
CHANGED
@@ -13,31 +13,7 @@ from branca.element import Figure
|
|
13 |
from functions import decode_features, get_weather_data, get_weather_df, get_weather_json_quick
|
14 |
##################
|
15 |
|
16 |
-
def greet(total_pred_days):
|
17 |
-
project = hopsworks.login()
|
18 |
-
|
19 |
-
mr=project.get_model_registry()
|
20 |
-
model = mr.get_model("temp_model_new", version=1)
|
21 |
-
model_dir=model.download()
|
22 |
-
|
23 |
-
model1 = mr.get_model("tempmax_model_new", version=1)
|
24 |
-
model_dir1=model1.download()
|
25 |
-
model2 = mr.get_model("tempmin_model_new", version=1)
|
26 |
-
model_dir2=model2.download()
|
27 |
-
|
28 |
-
model = joblib.load(model_dir + "/model_temp_new.pkl")
|
29 |
-
model1 = joblib.load(model_dir1 + "/model_tempmax_new.pkl")
|
30 |
-
model2 = joblib.load(model_dir2+ "/model_tempmin_new.pkl")
|
31 |
-
|
32 |
-
fs = project.get_feature_store()
|
33 |
-
weather_fg = fs.get_or_create_feature_group(
|
34 |
-
name = 'weather_fg',
|
35 |
-
version = 1
|
36 |
-
)
|
37 |
-
|
38 |
-
query = weather_fg.select_all()
|
39 |
-
Q = query.read()
|
40 |
-
|
41 |
str1 = ""
|
42 |
|
43 |
if(total_pred_days == ""):
|
@@ -59,10 +35,7 @@ def greet(total_pred_days):
|
|
59 |
name = 'weathernew_fv',
|
60 |
version = 1
|
61 |
)
|
62 |
-
print("get the fv")
|
63 |
|
64 |
-
|
65 |
-
global X
|
66 |
X = pd.DataFrame()
|
67 |
|
68 |
for i in range(count+1):
|
@@ -112,6 +85,35 @@ def greet(total_pred_days):
|
|
112 |
|
113 |
return str1
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
demo = gr.Interface(fn=greet, inputs = "text", outputs="text")
|
116 |
|
117 |
|
|
|
13 |
from functions import decode_features, get_weather_data, get_weather_df, get_weather_json_quick
|
14 |
##################
|
15 |
|
16 |
+
def greet(total_pred_days):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
str1 = ""
|
18 |
|
19 |
if(total_pred_days == ""):
|
|
|
35 |
name = 'weathernew_fv',
|
36 |
version = 1
|
37 |
)
|
|
|
38 |
|
|
|
|
|
39 |
X = pd.DataFrame()
|
40 |
|
41 |
for i in range(count+1):
|
|
|
85 |
|
86 |
return str1
|
87 |
|
88 |
+
#######################################################
|
89 |
+
# Preparations
|
90 |
+
project = hopsworks.login()
|
91 |
+
mr=project.get_model_registry()
|
92 |
+
|
93 |
+
model = mr.get_model("temp_model_new", version=1)
|
94 |
+
model_dir=model.download()
|
95 |
+
|
96 |
+
model1 = mr.get_model("tempmax_model_new", version=1)
|
97 |
+
model_dir1=model1.download()
|
98 |
+
|
99 |
+
model2 = mr.get_model("tempmin_model_new", version=1)
|
100 |
+
model_dir2=model2.download()
|
101 |
+
|
102 |
+
model = joblib.load(model_dir + "/model_temp_new.pkl")
|
103 |
+
model1 = joblib.load(model_dir1 + "/model_tempmax_new.pkl")
|
104 |
+
model2 = joblib.load(model_dir2+ "/model_tempmin_new.pkl")
|
105 |
+
|
106 |
+
fs = project.get_feature_store()
|
107 |
+
weather_fg = fs.get_or_create_feature_group(
|
108 |
+
name = 'weather_fg',
|
109 |
+
version = 1
|
110 |
+
)
|
111 |
+
|
112 |
+
query = weather_fg.select_all()
|
113 |
+
Q = query.read()
|
114 |
+
|
115 |
+
########################################################
|
116 |
+
# Gradio Interface
|
117 |
demo = gr.Interface(fn=greet, inputs = "text", outputs="text")
|
118 |
|
119 |
|