import gradio as gr from transformers import pipeline # Load the translation pipeline translator = pipeline("translation", model="Helsinki-NLP/opus-mt-mul-en") def translate(text): result = translator(text) return result[0]['translation_text'] # Create the Gradio interface iface = gr.Interface( fn=translate, inputs="text", outputs="text", title="Language Translator to English", description="Enter text in any language and get the translation in English." ) # Launch the app iface.launch(share=True)