Spaces:
Runtime error
Runtime error
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() |