Spaces:
Runtime error
Runtime error
Update src/model.py
Browse files- src/model.py +6 -6
src/model.py
CHANGED
@@ -20,9 +20,9 @@ class Model_Load:
|
|
20 |
# best_model_path='models/consumer_final_10/lightning_logs/lightning_logs/version_0/checkpoints/epoch=5-step=49260.ckpt'
|
21 |
# best_tft = TemporalFusionTransformer.load_from_checkpoint(best_model_path)
|
22 |
filename="models/cpu_energy_tft_model_v1.sav"
|
23 |
-
|
24 |
-
with open(filename, 'rb') as f:
|
25 |
-
|
26 |
print('Model Load Sucessfully.')
|
27 |
return best_tft
|
28 |
elif model_option=='Prophet':
|
@@ -44,9 +44,9 @@ class Model_Load:
|
|
44 |
# best_model_path="models/store_item_10_lead_1_v2/lightning_logs/lightning_logs/version_2/checkpoints/epoch=7-step=4472.ckpt"
|
45 |
# best_model_path="models/store_item_10_lead_1_v3/lightning_logs/lightning_logs/version_0/checkpoints/epoch=7-step=4472.ckpt"
|
46 |
# best_tft = TemporalFusionTransformer.load_from_checkpoint(best_model_path)
|
47 |
-
|
48 |
-
with open("models/cpu_finalized_model_v1.sav", 'rb') as f:
|
49 |
-
|
50 |
print('Model Load Sucessfully.')
|
51 |
return best_tft
|
52 |
elif model_option=='Prophet':
|
|
|
20 |
# best_model_path='models/consumer_final_10/lightning_logs/lightning_logs/version_0/checkpoints/epoch=5-step=49260.ckpt'
|
21 |
# best_tft = TemporalFusionTransformer.load_from_checkpoint(best_model_path)
|
22 |
filename="models/cpu_energy_tft_model_v1.sav"
|
23 |
+
best_tft=pickle.load(open(filename, 'rb'))
|
24 |
+
# with open(filename, 'rb') as f:
|
25 |
+
# best_tft=pd.read_pickle(f)
|
26 |
print('Model Load Sucessfully.')
|
27 |
return best_tft
|
28 |
elif model_option=='Prophet':
|
|
|
44 |
# best_model_path="models/store_item_10_lead_1_v2/lightning_logs/lightning_logs/version_2/checkpoints/epoch=7-step=4472.ckpt"
|
45 |
# best_model_path="models/store_item_10_lead_1_v3/lightning_logs/lightning_logs/version_0/checkpoints/epoch=7-step=4472.ckpt"
|
46 |
# best_tft = TemporalFusionTransformer.load_from_checkpoint(best_model_path)
|
47 |
+
best_tft=pickle.load(open("models/cpu_finalized_model_v1.sav", 'rb'))
|
48 |
+
# with open("models/cpu_finalized_model_v1.sav", 'rb') as f:
|
49 |
+
# best_tft=pd.read_pickle(f)
|
50 |
print('Model Load Sucessfully.')
|
51 |
return best_tft
|
52 |
elif model_option=='Prophet':
|