import gradio as gr from transformers import pipeline translation = pipeline("translation", "Shularp/krirk-finetuned-Helsinki-NLP_opus-mt-ar-en") def translate(text): results = translation(text) return results[0]["translation_text"] interface = gr.Interface(fn=translate, inputs="text", outputs=["text"], title = "Translator", description="Arabic-English translation machine") interface.launch()