CASLL commited on
Commit
7de0515
1 Parent(s): bc0f0e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -1,13 +1,15 @@
1
  import streamlit as st
 
2
 
3
- title = st.title("Tradutor FR to EN")
 
 
 
4
 
5
- txt = st.text_area(
6
- "Setença para traduzir:",
7
-
8
- )
9
 
10
  if st.button("Traduzir"):
11
- fr_txt = txt
12
- title = st.text_input("Tradução", fr_txt)
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