tradutorEn2Br / app.py
joinfv's picture
Update app.py
816e7e7 verified
raw
history blame contribute delete
378 Bytes
import gradio as gr
from transformers_js_py import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-pt")
def predict(text):
return pipe(text)[0]["translation_text"]
titulo = "tradutor Inglês para Brazileirez"
igr = gr.Interface(
fn=predict,
inputs=[gr.Textbox(label="text", lines=3)],
outputs='text',
title=titulo,
)
igr.launch()