Spaces:
Running on Zero
Running on Zero
Download src/task/config.py from zeguru/tiny-transformers: direct link, hf CLI and curl.
- Browser
- Download file 926 Bytes
-
https://huggingface.co/spaces/zeguru/tiny-transformers/resolve/main/src/task/config.py
- Command line
-
hf download hf://spaces/zeguru/tiny-transformers/src/task/config.py
-
curl -L -o config.py https://huggingface.co/spaces/zeguru/tiny-transformers/resolve/main/src/task/config.py
926 Bytes
| from dataclasses import dataclass | |
| #thank you v3.7 | |
| class ModelConfig: | |
| context_length: int = 64 #disambiguation is needed here... my head is spinning | |
| # max_length: int = 512 #length of single input (truncation + padding concerns) | |
| d_model: int = 64 #model dim | |
| d_ff: int = 256 #feed forward dim | |
| num_layers: int = 2 #transformer blocks | |
| number_of_heads: int = 2 | |
| dropout: float = 0.1 #percent. avoid overfitting, break emerging biases | |
| class TrainingConfig: | |
| batch_size: int = 32 | |
| learning_rate: float = 0.001 #the value added/subtracted to gradients | |
| num_steps: int = 100 | |
| eval_interval: int = 10 | |
| eval_batches: int = 20 | |
| num_train_samples: int | None = None #None for all, or limit to N samples for testing | |
| #need to connect to config file or cli args | |
| class RuntimeConfig: | |
| number_of_heads: int = 2 | |