Made-With-ML/tests/model/utils.py
2023-09-18 22:03:20 -07:00

10 lines
274 B
Python

import ray
from madewithml import predict
def get_label(text, predictor):
sample_ds = ray.data.from_items([{"title": text, "description": "", "tag": "other"}])
results = predict.predict_proba(ds=sample_ds, predictor=predictor)
return results[0]["prediction"]