affine commited on
Commit
6942901
1 Parent(s): 2342cb5

Update src/model.py

Browse files
Files changed (1) hide show
  1. src/model.py +6 -2
src/model.py CHANGED
@@ -20,7 +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
- best_tft=pickle.load(open(filename, 'rb'))
 
 
24
  print('Model Load Sucessfully.')
25
  return best_tft
26
  elif model_option=='Prophet':
@@ -42,7 +44,9 @@ class Model_Load:
42
  # best_model_path="models/store_item_10_lead_1_v2/lightning_logs/lightning_logs/version_2/checkpoints/epoch=7-step=4472.ckpt"
43
  # best_model_path="models/store_item_10_lead_1_v3/lightning_logs/lightning_logs/version_0/checkpoints/epoch=7-step=4472.ckpt"
44
  # best_tft = TemporalFusionTransformer.load_from_checkpoint(best_model_path)
45
- best_tft=pickle.load(open("models/cpu_finalized_model_v1.sav", 'rb'))
 
 
46
  print('Model Load Sucessfully.')
47
  return best_tft
48
  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':