Spaces:
Runtime error
Runtime error
add submit button
Browse files
app.py
CHANGED
@@ -9,10 +9,11 @@ st.title("Demo translate VI - EN")
|
|
9 |
|
10 |
input_text = st.text_area("Input the Vietnamese text:", "")
|
11 |
|
12 |
-
if
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
9 |
|
10 |
input_text = st.text_area("Input the Vietnamese text:", "")
|
11 |
|
12 |
+
if st.button("Submit"):
|
13 |
+
if input_text:
|
14 |
+
encoded_text = tokenizer(input_text, return_tensors="pt", padding=True, truncation=True)
|
15 |
+
|
16 |
+
translated_text = translator(input_text)
|
17 |
+
|
18 |
+
st.write("Translation Vietnamese to English:")
|
19 |
+
st.write(translated_text[0]["translation_text"])
|