Views
No views yet
| Parameter | Value |
|---|---|
| d_model | 512 |
| Encoder/Decoder layers | 6 |
| Attention heads | 8 |
| Feed-forward dimension | 2048 |
| Dropout | 0.1 |
| Max sequence length | 256 |
| Source vocab size | 30,000 |
| Target vocab size | 30,000 |
| Total parameters | ~90.5M |
Whitespace pre-tokenization.Note: This is a baseline tokenizer. A future version will use BPE with ByteLevel pre-tokenization for better handling of Bengali morphology and out-of-vocabulary words.
1import torch
2from tokenizers import Tokenizer
3from model import transformer_work
4from config import get_config
5
6config = get_config()
7
8# Load tokenizers
9tokenizer_src = Tokenizer.from_file("tokenizeren.json")
10tokenizer_tgt = Tokenizer.from_file("tokenizerbn.json")
11
12# Build model
13model = transformer_work(
14 src_vocab=tokenizer_src.get_vocab_size(),
15 tgt_vocab=tokenizer_tgt.get_vocab_size(),
16 src_seq_len=config["seq_len"],
17 tgt_seq_len=config["seq_len"],
18 d_model=config["d_model"],
19)
20
21# Load full checkpoint (includes optimizer state)
22device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
23checkpoint = torch.load("model_full_checkpoint.pt", map_location=device)
24model.load_state_dict(checkpoint["model_state_dict"])
25model.to(device)
26model.eval()evaluate.py in the source repository.| File | Description |
|---|---|
config.json | Model architecture and training configuration |
model_full_checkpoint.pt | Full training checkpoint (model + optimizer + scheduler + scaler) |
model_weights.pt | Model weights only (for inference) |
tokenizeren.json | English WordLevel tokenizer |
tokenizerbn.json | Bengali WordLevel tokenizer |