ikoghoemmanuell commited on
Commit
cbf1516
1 Parent(s): 04636e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -5,6 +5,7 @@ from PIL import Image
5
  import requests
6
  from bokeh.plotting import figure
7
  from bokeh.models import HoverTool
 
8
  import joblib
9
  import os
10
  from date_features import getDateFeatures
@@ -13,12 +14,10 @@ from date_features import getDateFeatures
13
  assets_dir = "assets/ML components"
14
  model_path = os.path.join(assets_dir, 'model.pkl')
15
  encoder_path = os.path.join(assets_dir, 'encoder.pkl')
16
- # model_path = os.path.join(current_dir, 'model.pkl')
17
- # encoder_path = os.path.join(current_dir, 'encoder.pkl')
18
 
19
- # Load the model and encoder from the pickle file
20
- model = joblib.load(model_path)
21
- encoder = joblib.load(encoder_path)
22
 
23
  # Set Page Configurations
24
  st.set_page_config(page_title="ETA Prediction App", page_icon="fas fa-chart-line", layout="wide", initial_sidebar_state="auto")
 
5
  import requests
6
  from bokeh.plotting import figure
7
  from bokeh.models import HoverTool
8
+ import torch
9
  import joblib
10
  import os
11
  from date_features import getDateFeatures
 
14
  assets_dir = "assets/ML components"
15
  model_path = os.path.join(assets_dir, 'model.pkl')
16
  encoder_path = os.path.join(assets_dir, 'encoder.pkl')
 
 
17
 
18
+ # Load the model and encoder from the Hugging Face assets folder
19
+ model = torch.hub.load(assets_dir, 'model')
20
+ encoder = torch.hub.load(assets_dir, 'encoder')
21
 
22
  # Set Page Configurations
23
  st.set_page_config(page_title="ETA Prediction App", page_icon="fas fa-chart-line", layout="wide", initial_sidebar_state="auto")