Spaces:
Sleeping
Sleeping
Add application file
Browse files
app.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
pipe = pipeline("thainq107/en-vi-mbart50")
|
| 5 |
+
st.title("Dự đoán với mô hình HuggingFace")
|
| 6 |
+
user_input = st.text_area("Nhập đoạn văn tiếng Anh:", "")
|
| 7 |
+
if st.button("Dự đoán"):
|
| 8 |
+
if user_input:
|
| 9 |
+
result = pipe(user_input)
|
| 10 |
+
st.write("Kết quả dự đoán:", result)
|
| 11 |
+
else:
|
| 12 |
+
st.write("Vui lòng nhập đoạn văn để dự đoán.")
|