[0241e6]: / api / app / load_model.py

Download this file

11 lines (8 with data), 271 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
import joblib
import os
# Load trained model
try:
GB_MODEL = os.path.join(os.path.dirname(__file__), '../../models/gradient_boosting.joblib')
model = joblib.load(open(GB_MODEL, 'rb'))
except FileNotFoundError as err:
print(f'Ann error occoured: {err}')