Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
3 |
|
4 |
-
#
|
5 |
|
6 |
# Create the app layout
|
7 |
st.title("Text Translation")
|
@@ -34,7 +34,7 @@ if submit_button:
|
|
34 |
output_ids = model.generate(input_ids)
|
35 |
|
36 |
# Decode the translated text
|
37 |
-
translated_text = tokenizer.decode(output_ids
|
38 |
|
39 |
# Display the translated text
|
40 |
st.write("Translated Text:", translated_text)
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
3 |
|
4 |
+
# "Helsinki-NLP/opus-mt-en-ro")
|
5 |
|
6 |
# Create the app layout
|
7 |
st.title("Text Translation")
|
|
|
34 |
output_ids = model.generate(input_ids)
|
35 |
|
36 |
# Decode the translated text
|
37 |
+
translated_text = tokenizer.decode(output_ids, skip_special_tokens=True)
|
38 |
|
39 |
# Display the translated text
|
40 |
st.write("Translated Text:", translated_text)
|