Spaces:
Runtime error
Runtime error
Arnaldo Mont'Alvao
commited on
Commit
•
67fc851
1
Parent(s):
42b5528
Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,10 @@ import streamlit as st
|
|
2 |
from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
|
4 |
#Load model
|
5 |
-
model = AutoModelForSeq2SeqLM.from_pretrained(
|
6 |
|
7 |
#Tokenizer
|
8 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
9 |
|
10 |
#Set up Translator
|
11 |
translator = pipeline('text2text-generation', model=model, tokenizer=tokenizer)
|
@@ -21,6 +21,6 @@ txt_input = st.text_input('Enter text here:')
|
|
21 |
if st.button('Submit'):
|
22 |
translation = translator(txt_input)
|
23 |
|
24 |
-
#Display translation
|
25 |
-
st.write(f'Translation: {translation}')
|
26 |
|
|
|
2 |
from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
|
4 |
#Load model
|
5 |
+
model = AutoModelForSeq2SeqLM.from_pretrained('unicamp-dl/translation-en-pt-t5')
|
6 |
|
7 |
#Tokenizer
|
8 |
+
tokenizer = AutoTokenizer.from_pretrained('unicamp-dl/translation-en-pt-t5')
|
9 |
|
10 |
#Set up Translator
|
11 |
translator = pipeline('text2text-generation', model=model, tokenizer=tokenizer)
|
|
|
21 |
if st.button('Submit'):
|
22 |
translation = translator(txt_input)
|
23 |
|
24 |
+
#Display translation
|
25 |
+
st.write(f'Translation: {translation}')
|
26 |
|