Views
No views yet
| Parameter | Description | Default Value | Type |
|---|---|---|---|
epochs | Number of training epochs | 4 | int |
block_size | Size of each block (context length) | 512 | int |
batch_size | Batch size for training | 64 | int |
inference | Inference mode (not specified) | None | None |
embeddings_dims | Dimensionality of embeddings | 512 | int |
attn_dropout | Dropout rate for attention layers | 0.1 | float |
no_of_heads | Number of attention heads | 8 | int |
dropout | Dropout rate for the model | 0.1 | float |
val_epochs | Number of validation epochs | 2 | int |
max_lr | Maximum learning rate | 6e-4 | float |
no_of_decoder_layers | Number of decoder layers | 8 | int |
weight_decay_optim | Weight decay for the optimizer | 0.1 | float |
beta_1 | Beta 1 for Adam optimizer | 0.9 | float |
beta_2 | Beta 2 for Adam optimizer | 0.95 | float |
clip | Gradient clipping value | 1.0 | float |
device | Device to run the model (cuda or cpu) | 'cuda' | str |
no_kv_heads | Number of key-value heads | 2 | int |
vocab_size | Size of the vocabulary | 50304 | int |
eps | Epsilon value for numerical stability | 1e-5 | float |
dtype | Data type for tensors (bfloat16 if supported, else float16) | 'bfloat16' or 'float16' | str |
save_checkpoint_dir | Directory to save model checkpoints | "checkpoints" | str |
prompt | Default prompt for inference | "Once upon a time" | str |
save_checkpoint_iter | Save checkpoint every N iterations | 50 | int |
total_iters | Total number of training iterations | 10000 | int |
eval_iters | Evaluate model every N iterations | 50 | int |
eval_check | Check evaluation metrics every N iterations | 100 | int |
warmup_iters | Number of warmup iterations for learning rate scheduling | 700 | int |
min_lr | Minimum learning rate (10% of max_lr) | 0.1 * max_lr | float |
lr_decay_iters | Number of iterations for learning rate decay | 10000 | int |
total_batch_size | Total batch size across all devices | 524288 | int |
micro_batch_size | Micro batch size per device | batch_size | int |
gradient_accumulation_steps | Gradient accumulation steps | total_batch_size // (micro_batch_size * (block_size * torch.cuda.device_count())) | int |
no_kv_heads | Number of key-value heads | 2 | int |





1git [clone the repo](https://github.com/YuvrajSingh-mist/SmolLlama.git)
2cd SmolLlama
3bash ./install.sh
4wandb loginpython donwload_model_weight.py -Dcd SmolLlama1
2python data.py --tinystories
3
4bash ./install.sh1
2python download_model_weight.py -sft/dpo/pretrained
31torchrun --standalone --nproc_per_node=gpu trainer.py \
2 --train P \
3 --epochs 4 \
4 --beta 0.1 \
5 --block_size 256 \
6 --batch_size 128 \
7 --embeddings_dims 512 \
8 --attn_dropout 0.1 \
9 --no_of_heads 8 \
10 --dropout 0.1 \
11 --val_epochs 2 \
12 --max_lr 6e-4 \
13 --no_of_decoder_layers 16 \
14 --weight_decay_optim 0.1 \
15 --beta_1 0.9 \
16 --beta_2 0.95 \
17 --clip 1.0 \
18 --device cuda \
19 --no_kv_heads 2 \
20 --vocab_size 50304 \
21 --eps 1e-5 \
22 --dtype "bfloat16" \
23 --save_checkpoint_dir "checkpoints" \
24 --prompt "Once upon a time" \
25 --save_checkpoint_iter 50 \
26 --total_iters 20000 \
27 --eval_iters 50 \
28 --eval_check 100 \
29 --warmup_iters 700 \
30 --min_lr 6e-5 \
31 --lr_decay_iters 20000 \
32 --total_batch_size 524288 \
33 --micro_batch_size 128 \
34 --gradient_accumulation_steps 4096
35 --max_length 100 \
36 --temperature 0.8python inference_sft.py --prompt "Follow the given instruction carefully. What was the Civil Rights Movement?" --max_length 256 --temperature 0.8 1
2cd gradio/
3
4pip install gradio
5
6python app.py
7