# Use a pipeline as a high-level helper from transformers import pipeline import gradio as gr pipe = pipeline("text2text-generation", model="basharalrfooh/Fine-Tashkeel") def diacratize_text(text): generated_text = pipe(text) return pipe(text)[0]['generated_text'] demo = gr.Interface( fn=diacratize_text, inputs=["text"], outputs=["text"], ) demo.launch()