DoNotChoke/MachineTranslation
0
1import streamlit as st2from transformers import pipeline3 4pipe = pipeline(model="thainq107/en-vi-mbart50")5st.title("Dịch với mô hình HuggingFace")6user_input = st.text_area("Nhập đoạn văn tiếng Anh:", "")7if st.button("Dịch"):8 if user_input:9 translated_text = pipe(user_input, num_beams=2, do_sample=False)10 result = translated_text[0]["generated_text"]11 st.write("Kết quả dịch:", result)12 else:13 st.write("Vui lòng nhập đoạn văn để dịch.")