Andrewstivan commited on
Commit
e26a254
·
verified ·
1 Parent(s): f244686

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py CHANGED
@@ -5,6 +5,30 @@ import json, torch, os, gc, sys
5
  from tqdm import tqdm
6
  from safetensors.torch import save_file, safe_open
7
  from huggingface_hub import hf_hub_download, HfApi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  class Plasticity:
10
  def __init__(self, n_neurons):
 
5
  from tqdm import tqdm
6
  from safetensors.torch import save_file, safe_open
7
  from huggingface_hub import hf_hub_download, HfApi
8
+ # ВРЕМЕННОЕ РЕШЕНИЕ: переопределяем конфиг прямо в app.py
9
+ import dataclasses
10
+
11
+ @dataclasses.dataclass
12
+ class BDHConfig:
13
+ n_layer: int = 32
14
+ n_embd: int = 4096
15
+ dropout: float = 0.1
16
+ n_head: int = 32
17
+ mlp_internal_dim_multiplier: int = 1
18
+ vocab_size: int = 256
19
+ use_alibi: bool = True
20
+ use_l1_norm: bool = True
21
+ relu_threshold: float = 0.0
22
+ rotary_embedding: str = "rope"
23
+ rope_theta: float = 65536.0
24
+ use_plasticity: bool = True
25
+ plasticity_lr: float = 0.01
26
+ consolidation_rate: float = 0.01
27
+ forget_rate: float = 0.1
28
+ use_rho_cache: bool = True
29
+
30
+ # Затем используем этот конфиг вместо импорта из bdh
31
+ # config = BDHConfig(n_layer=32, ...) # теперь работает!
32
 
33
  class Plasticity:
34
  def __init__(self, n_neurons):