Spaces:
Sleeping
Sleeping
File size: 324 Bytes
d7f4720 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import numpy as np
from joblib import load
from src.utils import MODEL_PATH
_model = None
def get_model():
global _model
if _model is None:
_model = load(MODEL_PATH)
return _model
def predict_one(x_row: np.ndarray) -> int:
mdl = get_model()
return int(mdl.predict(x_row.reshape(1, -1))[0])
|