phunlh2001 commited on
Commit
43fc44e
·
verified ·
1 Parent(s): c578893

add submit button

Browse files
Files changed (1) hide show
  1. app.py +8 -7
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 input_text:
13
- encoded_text = tokenizer(input_text, return_tensors="pt", padding=True, truncation=True)
14
-
15
- translated_text = translator(input_text)
16
-
17
- st.write("Translation Vietnamese to English:")
18
- st.write(translated_text[0]["translation_text"])
 
 
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"])