Subi003 commited on
Commit
e60f305
·
verified ·
1 Parent(s): cde95c2

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. main/helper.py +4 -3
main/helper.py CHANGED
@@ -1,12 +1,13 @@
1
  # Helper functions for the model inference api
2
-
3
  import yaml
4
  import joblib
5
  from pathlib import Path
6
 
7
  # load yaml files to get model meta data.
8
  try:
9
- with open(Path("app/model/registered_model_meta.yaml"), 'r') as f:
 
10
  model_metadata = yaml.safe_load(f)
11
  except:
12
  raise FileNotFoundError("Failed to load file having model metadata")
@@ -15,7 +16,7 @@ except:
15
  def load_model():
16
  """ Loads ML model from location path and returns the model. """
17
  try:
18
- with open(Path("app/model/python_model.pkl"), "rb") as f:
19
  model = joblib.load(f)
20
  return model
21
 
 
1
  # Helper functions for the model inference api
2
+ import os
3
  import yaml
4
  import joblib
5
  from pathlib import Path
6
 
7
  # load yaml files to get model meta data.
8
  try:
9
+ print(os.getcwd())
10
+ with open(Path("model/registered_model_meta.yaml"), 'r') as f:
11
  model_metadata = yaml.safe_load(f)
12
  except:
13
  raise FileNotFoundError("Failed to load file having model metadata")
 
16
  def load_model():
17
  """ Loads ML model from location path and returns the model. """
18
  try:
19
+ with open(Path("model/python_model.pkl"), "rb") as f:
20
  model = joblib.load(f)
21
  return model
22