turu / inference.py
tuva's picture
Update inference.py
613d903 verified
raw
history blame
439 Bytes
import joblib
from typing import List, Dict
# Загрузка модели
model_path = "model/language_classifier.joblib"
model = joblib.load(model_path)
# Функция для предсказания
def predict(texts: List[str]) -> List[Dict[str, float]]:
predictions = model.predict(texts)
results = []
for prediction in predictions:
results.append({"label": str(prediction), "score": 1.0})
return results