import gradio as gr from transformers import pipeline from normalizer import cleaning pipe = pipeline("fill-mask", model="HooshvareLab/albert-fa-zwnj-base-v2") def greet(text): text = cleaning(text) results = pipe(text) return results demo = gr.Interface(fn=greet, inputs=gr.Textbox(label='input text'), outputs=gr.Textbox(label="Normalized text:"), allow_flagging='never') demo.launch()