vonewman's picture
Update app.py
1033da7
raw
history blame contribute delete
500 Bytes
import gradio as gr
from transformers import pipeline
translator = pipeline("translation", model="Helsinki-NLP/opus-mt-en-fr")
def translate_sentence(input_text):
for value in translator(input_text)[0].values():
return value
iface = gr.Interface(fn = translate_sentence, inputs = 'text', outputs = 'text',
title = "Traduction EN-FR",
description="Un mini google translate avec huggingface")
iface.launch(inline = False)