Update app.py
Browse files
app.py
CHANGED
@@ -8,13 +8,13 @@ from transformers import pipeline
|
|
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 |
title = "Tradutor inglês para Brasileires"
|
15 |
|
16 |
iface = gr.Interface(
|
17 |
-
fn=
|
18 |
inputs=[gr.Textbox(label="text", lines=3)],
|
19 |
outputs='text',
|
20 |
title=title,
|
|
|
8 |
#load model
|
9 |
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-pt")
|
10 |
|
11 |
+
def predict(text):
|
12 |
return pipe(text)[0]["translation_text"]
|
13 |
|
14 |
title = "Tradutor inglês para Brasileires"
|
15 |
|
16 |
iface = gr.Interface(
|
17 |
+
fn=predict,
|
18 |
inputs=[gr.Textbox(label="text", lines=3)],
|
19 |
outputs='text',
|
20 |
title=title,
|