Skip to content

Commit

Permalink
Update score.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cindyweng committed Sep 1, 2022
1 parent 5ec5d8a commit e0c073c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classical/python-sdk/data-science/src/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ def init():

model_path = Model.get_model_path(args.model_name)
print(f"Model path: {model_path}")
model = joblib.load(os.path.join(model_path, 'model.pkl'))
if 'model.pkl' in model_path:
model = joblib.load(model_path)
else:
model = joblib.load(os.path.join(model_path, 'model.pkl'))

# load the explainer
explainer_path = os.path.join(Model.get_model_path(args.model_name), "explainer")
Expand Down Expand Up @@ -56,4 +59,4 @@ def run(file_list):
result = pd.concat([sno, proba], axis=1)
results = results.append(result)
print(f"Batch scored: {filename}")
return results
return results

0 comments on commit e0c073c

Please sign in to comment.