Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,15 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
)
|
9 |
|
10 |
if st.button("Traduzir"):
|
11 |
-
|
12 |
-
|
13 |
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
|
4 |
+
translator = pipeline(
|
5 |
+
"translation",
|
6 |
+
model="Helsinki-NLP/opus-mt-fr-en",
|
7 |
+
)
|
8 |
|
9 |
+
title = st.title("Tradutor FR to EN")
|
10 |
+
txt = st.text_area("Setença para traduzir:",)
|
|
|
|
|
11 |
|
12 |
if st.button("Traduzir"):
|
13 |
+
translation = translator(txt)
|
14 |
+
print(translation[0]['translation_text'])
|
15 |
|