Spaces:
Runtime error
Runtime error
File size: 323 Bytes
2e1bfaf |
1 2 3 4 5 6 7 8 9 10 11 |
@app.route("/predict", methods=["POST"])
@expects_json(SCHEMA)
def predict():
request_obj = g.data
text = request_obj["text"]
candidate_labels = request_obj["candidate_labels"]
# predict
prediction = ZeroShotTextClassifier.predict(
text=text,
candidate_labels=candidate_labels)
return jsonify(prediction) |