import gradio as gr from transformers import pipeline pipe = pipeline( "token-classification", model="DanielDDDS/hebrew-recipe-modification-ner", aggregation_strategy="simple" ) def predict(text): if isinstance(text, list): text = text[0] preds = pipe(text) return {"results": preds} demo = gr.Interface( fn=predict, inputs=gr.Textbox(label="Hebrew comment", placeholder="אפשר להחליף חמאה בשמן קוקוס"), outputs="json", title="Hebrew Recipe Modification Extractor", description="Extract recipe modifications from Hebrew YouTube comments", api_name="predict" # <--- this line forces the endpoint name ) demo.queue(max_size=10).launch()