Commit
•
bfe58e1
1
Parent(s):
f98ad70
change path, no load data
Browse files
app.py
CHANGED
@@ -233,31 +233,11 @@ def load_object(path: str):
|
|
233 |
|
234 |
def run(argv = None):
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
if not os.path.exists(path_raw):
|
242 |
-
data = load_data()
|
243 |
-
# save_object(data, path_raw)
|
244 |
-
|
245 |
-
else:
|
246 |
-
data = load_object(path_raw)
|
247 |
-
|
248 |
-
if not os.path.exists(path_preprocessed):
|
249 |
-
data_preprocessed = preprocess_data(data)
|
250 |
-
save_object(data_preprocessed, path_preprocessed)
|
251 |
-
else:
|
252 |
-
data_preprocessed = load_object(path_preprocessed)
|
253 |
-
|
254 |
-
if not os.path.exists(path_forecaster):
|
255 |
-
forecaster = predict_dataframe(data_preprocessed)
|
256 |
-
save_object(forecaster, path_forecaster)
|
257 |
-
else:
|
258 |
-
|
259 |
-
forecaster = load_object(path_forecaster)
|
260 |
-
|
261 |
pred = forecaster.predict()
|
262 |
|
263 |
def wrapper(sector_origin, sector_destiny, type_prediction):
|
@@ -276,9 +256,7 @@ def run(argv = None):
|
|
276 |
"maximum": 16,
|
277 |
"step": 1
|
278 |
}
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
|
283 |
port = int(os.environ.get("GRADIO_SERVER_PORT", 7860))
|
284 |
|
|
|
233 |
|
234 |
def run(argv = None):
|
235 |
|
236 |
+
path_preprocessed = "./data_preprocessed.pkl"
|
237 |
+
path_forecaster = "./forecaster.pkl"
|
238 |
+
|
239 |
+
data_preprocessed = load_object(path_preprocessed)
|
240 |
+
forecaster = predict_dataframe(data_preprocessed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
pred = forecaster.predict()
|
242 |
|
243 |
def wrapper(sector_origin, sector_destiny, type_prediction):
|
|
|
256 |
"maximum": 16,
|
257 |
"step": 1
|
258 |
}
|
259 |
+
|
|
|
|
|
260 |
|
261 |
port = int(os.environ.get("GRADIO_SERVER_PORT", 7860))
|
262 |
|