CaxtonEmeraldS commited on
Commit
c02b756
·
verified ·
1 Parent(s): 729e640

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -17,12 +17,15 @@ if not os.path.exists(unzip_dir):
17
  print("Extraction complete.")
18
 
19
  # Step 2: Parse folders to dynamically populate dropdowns
 
 
 
20
  activations = []
21
- seeds_dict = dict() # activation -> list of seeds
22
- neurons_dict = dict() # (activation, seed) -> list of neuron counts
23
 
24
- for act in os.listdir(os.path.join(unzip_dir, 'Models')):
25
- act_path = os.path.join(os.path.join(unzip_dir, 'Models'), act)
26
  if os.path.isdir(act_path) and not act.startswith("linear_models"):
27
  activations.append(act)
28
  seeds = []
@@ -40,6 +43,13 @@ for act in os.listdir(os.path.join(unzip_dir, 'Models')):
40
 
41
  activations = sorted(activations)
42
 
 
 
 
 
 
 
 
43
  # Step 3: Load linear models
44
  # linear_rgb_path = os.path.join(unzip_dir, "linear_models/linear_rgb.joblib")
45
  # linear_grey_path = os.path.join(unzip_dir, "linear_models/linear_grey.joblib")
 
17
  print("Extraction complete.")
18
 
19
  # Step 2: Parse folders to dynamically populate dropdowns
20
+
21
+ model_root = os.path.join(unzip_dir, 'Models') # Adjust this if your ZIP structure is different
22
+
23
  activations = []
24
+ seeds_dict = dict()
25
+ neurons_dict = dict()
26
 
27
+ for act in os.listdir(model_root):
28
+ act_path = os.path.join(model_root, act)
29
  if os.path.isdir(act_path) and not act.startswith("linear_models"):
30
  activations.append(act)
31
  seeds = []
 
43
 
44
  activations = sorted(activations)
45
 
46
+ def update_seeds(activation):
47
+ return {"choices": seeds_dict[activation], "value": seeds_dict[activation][0]}
48
+
49
+ def update_neurons(activation, seed):
50
+ neurons = neurons_dict[(activation, seed)]
51
+ return {"choices": neurons, "value": neurons[0]}
52
+
53
  # Step 3: Load linear models
54
  # linear_rgb_path = os.path.join(unzip_dir, "linear_models/linear_rgb.joblib")
55
  # linear_grey_path = os.path.join(unzip_dir, "linear_models/linear_grey.joblib")