Commit ·
3c61975
1
Parent(s): 13d7a4d
Update app
Browse files- src/streamlit_app.py +4 -4
- src/utils.py +0 -2
src/streamlit_app.py
CHANGED
|
@@ -96,19 +96,19 @@ st.title("🤖 AI Translator: English → Vietnamese")
|
|
| 96 |
st.markdown("### Project: *Attention Is All You Build*")
|
| 97 |
st.markdown("---")
|
| 98 |
|
| 99 |
-
# Sidebar
|
| 100 |
with st.sidebar:
|
| 101 |
st.header("ℹ️ Thông tin Model")
|
| 102 |
st.info(
|
| 103 |
"""
|
| 104 |
Đây là mô hình **Transformer (Encoder-Decoder)** được xây dựng "from scratch" bằng PyTorch.
|
| 105 |
-
|
| 106 |
- **Kiến trúc**: Pre-LN Transformer
|
| 107 |
- **Tokenizer**: BPE (32k vocab)
|
| 108 |
- **Inference**: Greedy
|
| 109 |
"""
|
| 110 |
)
|
| 111 |
-
st.write("Created by [
|
| 112 |
|
| 113 |
# Input Area
|
| 114 |
input_text = st.text_area(
|
|
@@ -121,7 +121,7 @@ input_text = st.text_area(
|
|
| 121 |
# 4. INFERENCE LOGIC
|
| 122 |
# ==========================================
|
| 123 |
|
| 124 |
-
#
|
| 125 |
if st.button("Dịch sang Tiếng Việt (Translate)"):
|
| 126 |
if not input_text.strip():
|
| 127 |
st.warning("⚠️ Vui lòng nhập nội dung cần dịch!")
|
|
|
|
| 96 |
st.markdown("### Project: *Attention Is All You Build*")
|
| 97 |
st.markdown("---")
|
| 98 |
|
| 99 |
+
# Sidebar
|
| 100 |
with st.sidebar:
|
| 101 |
st.header("ℹ️ Thông tin Model")
|
| 102 |
st.info(
|
| 103 |
"""
|
| 104 |
Đây là mô hình **Transformer (Encoder-Decoder)** được xây dựng "from scratch" bằng PyTorch.
|
| 105 |
+
|
| 106 |
- **Kiến trúc**: Pre-LN Transformer
|
| 107 |
- **Tokenizer**: BPE (32k vocab)
|
| 108 |
- **Inference**: Greedy
|
| 109 |
"""
|
| 110 |
)
|
| 111 |
+
st.write("Created by [Lê Hồ Long]")
|
| 112 |
|
| 113 |
# Input Area
|
| 114 |
input_text = st.text_area(
|
|
|
|
| 121 |
# 4. INFERENCE LOGIC
|
| 122 |
# ==========================================
|
| 123 |
|
| 124 |
+
# Translation Button
|
| 125 |
if st.button("Dịch sang Tiếng Việt (Translate)"):
|
| 126 |
if not input_text.strip():
|
| 127 |
st.warning("⚠️ Vui lòng nhập nội dung cần dịch!")
|
src/utils.py
CHANGED
|
@@ -7,8 +7,6 @@ import torch
|
|
| 7 |
from torch import Tensor
|
| 8 |
from transformers.tokenization_utils_fast import PreTrainedTokenizerFast
|
| 9 |
from jaxtyping import Bool, Int
|
| 10 |
-
|
| 11 |
-
# from src import model
|
| 12 |
import model
|
| 13 |
|
| 14 |
|
|
|
|
| 7 |
from torch import Tensor
|
| 8 |
from transformers.tokenization_utils_fast import PreTrainedTokenizerFast
|
| 9 |
from jaxtyping import Bool, Int
|
|
|
|
|
|
|
| 10 |
import model
|
| 11 |
|
| 12 |
|