import gradio as gr import transformers import sentencepiece from transformers import pipeline translator=pipeline("translation",model='Helsinki-NLP/opus-mt-fr-en') def Get_Translation(input_text): texte=translator(input_text) result= texte[0]['translation_text'] return result iface = gr.Interface(fn=Get_Translation, title='Text Translation', inputs='text', outputs='text', description='Get translation of giving input').launch()