Download config.py from Kat-AI/Kat: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/Kat-AI/Kat/resolve/main/config.py
- Command line
-
hf download hf://Kat-AI/Kat/config.py
-
curl -L -o config.py https://huggingface.co/Kat-AI/Kat/resolve/main/config.py
1.12 kB
| """All hyperparameters for Kat in one place.""" | |
| from dataclasses import dataclass | |
| from pathlib import Path | |
| ROOT = Path(__file__).parent | |
| DATA_DIR = ROOT / "data" | |
| # Special tokens. Kept as literal strings so data.py can write them into the | |
| # text files before a tokenizer exists. | |
| USER, BOT, EOS, PAD = "<|user|>", "<|bot|>", "<|eos|>", "<|pad|>" | |
| SPECIALS = [PAD, USER, BOT, EOS] | |
| class DataConfig: | |
| dataset: str = "li2017dailydialog/daily_dialog" | |
| # The main branch ships only a loading script, which datasets>=4 refuses to | |
| # run. The auto-converted parquet branch carries the actual data. | |
| revision: str = "refs/convert/parquet" | |
| lowercase: bool = True | |
| class ModelConfig: | |
| vocab_size: int = 8000 | |
| block_size: int = 128 | |
| n_layer: int = 4 | |
| n_head: int = 4 | |
| n_embd: int = 256 | |
| dropout: float = 0.1 | |
| class TrainConfig: | |
| batch_size: int = 32 | |
| max_steps: int = 4000 | |
| lr: float = 3e-4 | |
| warmup_steps: int = 100 | |
| weight_decay: float = 0.1 | |
| grad_clip: float = 1.0 | |
| eval_every: int = 250 | |
| eval_batches: int = 40 | |
| seed: int = 1337 | |