Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,16 @@
|
|
1 |
-
# Tradutor NQ usando pipelines
|
2 |
-
# Autor..: joinfv
|
3 |
-
# Data...: 20/11/2024
|
4 |
import gradio as gr
|
5 |
|
6 |
from transformers import pipeline
|
7 |
|
8 |
-
# Load model
|
9 |
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-pt")
|
10 |
|
11 |
-
def
|
12 |
return pipe(text)[0]["translation_text"]
|
13 |
-
|
14 |
titulo = "tradutor Inglês para Brazileirez"
|
15 |
|
16 |
igr = gr.Interface(
|
17 |
-
fn=
|
18 |
inputs=[gr.Textbox(label="text", lines=3)],
|
19 |
outputs='text',
|
20 |
title=titulo,
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
from transformers import pipeline
|
4 |
|
|
|
5 |
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-pt")
|
6 |
|
7 |
+
def traduzir(text):
|
8 |
return pipe(text)[0]["translation_text"]
|
9 |
+
|
10 |
titulo = "tradutor Inglês para Brazileirez"
|
11 |
|
12 |
igr = gr.Interface(
|
13 |
+
fn=traduzir,
|
14 |
inputs=[gr.Textbox(label="text", lines=3)],
|
15 |
outputs='text',
|
16 |
title=titulo,
|