Download scratch/check_mini_params.py from ViuAI/ViuMini-Dense-360M: direct link, hf CLI and curl.
- Browser
- Download file 622 Bytes
-
https://huggingface.co/ViuAI/ViuMini-Dense-360M/resolve/main/scratch/check_mini_params.py
- Command line
-
hf download hf://ViuAI/ViuMini-Dense-360M/scratch/check_mini_params.py
-
curl -L -o check_mini_params.py https://huggingface.co/ViuAI/ViuMini-Dense-360M/resolve/main/scratch/check_mini_params.py
622 Bytes
| import yaml | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(ROOT / "model" / "scripts")) | |
| import viu1_dense | |
| with open(ROOT / "model" / "configs" / "viu1_dense_config.yaml", "r") as f: | |
| cfg = yaml.safe_load(f) | |
| args = viu1_dense.load_args(ROOT / "model" / "configs" / "viu1_dense_config.yaml") | |
| model = viu1_dense.Viu1Dense(args) | |
| total, active = model.param_counts() | |
| print(f"Total params in ViuMini-Dense-360M: {total:,} ({total/1e6:.1f}M) | Active: {active:,}") | |
| print(f"Layers: {args.n_layers}, Dim: {args.dim}, Heads: {args.n_heads}, KV Heads: {args.n_kv_heads}") | |