Download code/config.py from Jommarn/Qwen3.5-0.8B-NestedMemory-v5: direct link, hf CLI and curl.
- Browser
- Download file 1.55 kB
-
https://huggingface.co/Jommarn/Qwen3.5-0.8B-NestedMemory-v5/resolve/main/code/config.py
- Command line
-
hf download hf://Jommarn/Qwen3.5-0.8B-NestedMemory-v5/code/config.py
-
curl -L -o config.py https://huggingface.co/Jommarn/Qwen3.5-0.8B-NestedMemory-v5/resolve/main/code/config.py
1.55 kB
| from dataclasses import dataclass | |
| import torch | |
| def get_default_device() -> str: | |
| if torch.cuda.is_available(): | |
| return "cuda" | |
| if torch.backends.mps.is_available(): | |
| return "mps" | |
| return "cpu" | |
| class ProjectConfig: | |
| base_model: str = "Qwen/Qwen3.5-0.8B" | |
| device: str = get_default_device() | |
| dtype: torch.dtype = torch.float32 | |
| # Memory placement (~3/4 of transformer layers -> Layer 18 of 24) | |
| mem_after_layer_ratio: float = 0.75 | |
| # GatedSlotMemory / LifeMemoryMoE defaults | |
| n_experts: int = 8 | |
| n_slots: int = 2048 | |
| topk_slots: int = 16 | |
| k_experts: int = 2 | |
| # Sleep consolidation & forgetting defaults | |
| decay_per_day: float = 0.03 | |
| retire_below: float = 0.05 | |
| lam_kl: float = 1.0 | |
| lam_gate: float = 0.5 | |
| lr: float = 1e-4 | |
| # NestedMemoryLayer options (defaults = Titans-style baseline; see Model/nested_memory.py) | |
| mem_d_mem: int = 256 # width of the linear associative memory M (d_mem x d_key) | |
| mem_inner_steps: int = 4 | |
| mem_poly_dim: int = 0 # Atlas polynomial feature map (0 = off) | |
| mem_omega_window: int = 1 # Atlas Omega rule window (1 = off) | |
| mem_muon: bool = False # Atlas Muon / Newton-Schulz update | |
| mem_shift_key: bool = False # v3: key from token t-1 -> value of token t (retrieval of what followed) | |
| mem_res_rel: bool = False # v3: memory injection scaled by the residual stream RMS | |
| mem_extra_layers: tuple = () # v5: additional memory layers injected after these decoder layers | |