AbstractPhil commited on
Commit
d138161
·
verified ·
1 Parent(s): 735e468

Update configs.py

Browse files
Files changed (1) hide show
  1. configs.py +694 -42
configs.py CHANGED
@@ -1,66 +1,400 @@
1
- T5_SHUNT_REPOS = {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  "clip_g": {
3
- "models": ["vit-bigG-14", 'flan-t5-base'],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  "config": {
5
  "adapter_id": "003", "name": "DualShuntAdapter-G",
6
- "t5": {
 
7
  "model": "google/flan-t5-base",
8
  "hidden_size": 768
9
- },
10
- "clip": {
11
- "model": "openai/clip-vit-large-patch14",
12
- "hidden_size": 1280
13
- },
 
 
 
14
  "hidden_size": 1280, # This is the adapter's output size
15
  "bottleneck": 640, "heads": 20,
16
- "tau_init": 0.1, "max_guidance": 10.0,
17
- "proj_layers": 2, "layer_norm": True, "dropout": 0.1,
18
- "use_dropout": True, "use_proj_stack": True, "assert_input_dims": True,
19
  "routing": {"type": "cross_attention", "enable_causal_mask": False, "bidirectional": True},
20
  "version": "v0.3.2"
21
  },
22
- "repo": "AbstractPhil/t5-flan-base-vit-bigG-14-dual-stream-adapter",
 
 
 
23
  "shunts_available": {
24
  "shunt_type_name": "DualStreamAdapter-G",
25
  "config_file_name": "config.json",
26
  "shunt_list": [
27
- "t5-flan-vit-bigG-14-dual_shunt_caption.safetensors",
28
- "t5-flan-vit-bigG-14-dual_shunt_no_caption_e1.safetensors",
29
- "t5-flan-vit-bigG-14-dual_shunt_no_caption_e2.safetensors",
30
- "t5-flan-vit-bigG-14-dual_shunt_no_caption_e3.safetensors",
31
- "t5-flan-vit-bigG-14-dual_shunt_summarize.safetensors",
32
- "dual_shunt_omega_no_caption_e1_step_10000.safetensors",
33
- "dual_shunt_omega_no_caption_noised_e1_step_1000.safetensors",
34
- "dual_shunt_omega_no_caption_noised_e1_step_4000.safetensors",
35
- "dual_shunt_omega_no_caption_noised_e1_step_10000.safetensors",
 
 
 
 
 
 
 
 
 
 
 
 
36
  ],
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  },
39
- "clip_l": {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  "models": ["vit-l-14", 'flan-t5-base'],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  "config": {
42
  "adapter_id": "002",
43
  "name": "DualShuntAdapter",
44
- "t5": {"model": "google/flan-t5-base", "hidden_size": 768},
45
- "clip": {"model": "openai/clip-vit-large-patch14", "hidden_size": 768},
 
 
 
 
 
 
 
 
46
  "hidden_size": 768, # This is the adapter's output size
47
  "bottleneck": 384, "heads": 12,
48
- "tau_init": 0.1, "max_guidance": 10.0,
49
- "proj_layers": 2, "layer_norm": True, "dropout": 0.1,
50
- "use_dropout": True, "use_proj_stack": True, "assert_input_dims": True,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  "routing": {"type": "cross_attention", "enable_causal_mask": False, "bidirectional": True},
52
  "version": "v0.3.2"
53
  },
54
- "repo": "AbstractPhil/t5-flan-base-vit-l-14-dual-stream-adapter",
55
  "shunts_available": {
56
  "shunt_type_name": "DualStreamAdapter-L",
57
  "config_file_name": "config.json",
58
  "shunt_list": [
59
- "t5-vit-l-14-dual_shunt_caption.safetensors",
60
- "t5-vit-l-14-dual_shunt_no_caption.safetensors",
61
- "t5-vit-l-14-dual_shunt_summarize.safetensors",
62
- "t5-vit-l-14-dual_shunt_booru_13_000_000.safetensors",
63
- "t5-vit-l-14-dual_shunt_booru_51_200_000.safetensors",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  ],
65
  },
66
  }
@@ -68,38 +402,173 @@ T5_SHUNT_REPOS = {
68
 
69
  # ─── Adapter Configs ─────────────────────────────────────────────
70
 
71
- BERT_CONFIGS = {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  "mobilebert-base-uncased": {
73
  "repo_name": "google/mobilebert-uncased",
 
 
74
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
75
  "subfolder": "",
76
  },
77
  "bert-base-uncased": {
78
  "repo_name": "bert-base-uncased",
 
 
79
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
80
  },
81
  "bert-large-uncased": {
82
  "repo_name": "bert-large-uncased",
 
 
83
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
84
  },
85
  "bert-base-cased": {
86
  "repo_name": "bert-base-cased",
 
 
87
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
88
- }
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
- T5_CONFIGS = {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  "flan-t5-base": {
93
  "repo_name": "google/flan-t5-base",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
95
  },
96
  "t5-small": {
97
  "repo_name": "google-t5/t5-small",
 
 
98
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
99
-
100
  },
101
  "t5_small_human_attentive_try2_pass3": {
102
- "repo_name": "AbstractPhil/t5_small_human_attentive_try2_pass3",
 
 
103
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
104
  # the necessary config is present here for posterity in case it fails to load from HuggingFace.
105
  "subfolder": "",
@@ -110,7 +579,7 @@ T5_CONFIGS = {
110
  "architectures": [
111
  "T5ForConditionalGeneration"
112
  ],
113
- "attention_dropout": 0.3,
114
  "classifier_dropout": 0.0,
115
  "d_ff": 2048,
116
  "d_kv": 64,
@@ -148,4 +617,187 @@ T5_CONFIGS = {
148
  "vocab_size": 32128
149
  }
150
  }
151
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+ from typing import Optional
3
+ import logging
4
+ logger = logging.getLogger(__name__)
5
+
6
+
7
+
8
+
9
+ DEFAULT_REPOS = {
10
+ "clip_g": "laion/CLIP-ViT-bigG-14-laion2B-39B-b160k",
11
+ "vit-bigG-14": "laion/CLIP-ViT-bigG-14-laion2B-39B-b160k",
12
+ "clip_l": "openai/clip-vit-large-patch14",
13
+ "vit-l-14": "openai/clip-vit-large-patch14",
14
+ "clip_l_4h": "openai/clip-vit-large-patch14",
15
+ "clip_l_x52": "AbstractPhil/beatrix-x52",
16
+ "clip_h": "openai/clip-vit-large-patch14-h",
17
+ "clip_vision": "openai/clip-vit-large-patch14-vision",
18
+ "t5_base": "google/flan-t5-base",
19
+ "t5_small": "google-t5/t5-small",
20
+ "t5_unchained": "AbstractPhil/t5-unchained",
21
+ "bert_beatrix": "AbstractPhil/bert-beatrix-2048",
22
+ "nomic_bert": "nomic-ai/nomic-bert-2048",
23
+ "mobilebert": "google/mobilebert-uncased",
24
+ "bert_base_uncased": "bert-base-uncased",
25
+ "bert_large_uncased": "bert-large-uncased",
26
+ "bert_base_cased": "bert-base-cased",
27
+ "bert_base_multilingual": "bert-base-multilingual-uncased",
28
+ "bert_base_multilingual_cased": "bert-base-multilingual-cased",
29
+ }
30
+
31
+ HARMONIC_SHUNT_REPOS = {
32
  "clip_g": {
33
+ "models": ['t5_base', "clip_g"],
34
+ "repo": "AbstractPhil/t5-flan-base-vit-bigG-14-dual-stream-adapter",
35
+ "shunts_available": {
36
+ "shunt_type_name": "DualStreamAdapter-G",
37
+ "config_file_name": "config.json",
38
+ "shunt_list": [
39
+ {"name": "flan-t5-base+clip_g:caption", "file": "t5-flan-vit-bigG-14-dual_shunt_caption.safetensors" },
40
+ {"name": "flan-t5-base+clip_g:noise-e1", "file": "t5-flan-vit-bigG-14-dual_shunt_no_caption_e1.safetensors" },
41
+ {"name": "flan-t5-base+clip_g:noise-e3", "file": "t5-flan-vit-bigG-14-dual_shunt_no_caption_e2.safetensors" },
42
+ {"name": "flan-t5-base+clip_g:noise-e3", "file": "t5-flan-vit-bigG-14-dual_shunt_no_caption_e3.safetensors" },
43
+ {"name": "flan-t5-base+clip_g:summarize", "file": "t5-flan-vit-bigG-14-dual_shunt_summarize.safetensors" },
44
+ {"name": "flan-t5-base+clip_g_omega32:noise-10000", "file": "dual_shunt_omega_no_caption_e1_step_10000.safetensors" },
45
+ {"name": "flan-t5-base+clip_g_omega32:noise-1000", "file": "dual_shunt_omega_no_caption_noised_e1_step_1000.safetensors" },
46
+ {"name": "flan-t5-base+clip_g_omega32:noise-4000", "file": "dual_shunt_omega_no_caption_noised_e1_step_4000.safetensors" },
47
+ {"name": "flan-t5-base+clip_g_omega32:noise-10000v2", "file": "dual_shunt_omega_no_caption_noised_e1_step_10000.safetensors" },
48
+ ],
49
+ },
50
  "config": {
51
  "adapter_id": "003", "name": "DualShuntAdapter-G",
52
+ "condition_encoders": [{
53
+ "type": "t5_base",
54
  "model": "google/flan-t5-base",
55
  "hidden_size": 768
56
+ }],
57
+ "modulation_encoders": [
58
+ {
59
+ "type": "clip_g",
60
+ "model": "laion/CLIP-ViT-bigG-14-laion2B-39B-b160k",
61
+ "hidden_size": 1280
62
+ }
63
+ ],
64
  "hidden_size": 1280, # This is the adapter's output size
65
  "bottleneck": 640, "heads": 20,
66
+ "max_guidance": 10.0, "tau_init": 0.1,
67
+ "proj_layers": 2, "layer_norm": True, "dropout": 0.0,
68
+ "use_dropout": False, "use_proj_stack": True, "assert_input_dims": True,
69
  "routing": {"type": "cross_attention", "enable_causal_mask": False, "bidirectional": True},
70
  "version": "v0.3.2"
71
  },
72
+ },
73
+ "clip_g_8h": {
74
+ "models": ['bert_beatrix-2048', "clip_g"],
75
+ "repo": "AbstractPhil/bert-beatrix-2048-vit-bigG-14-dual-shunt-adapter",
76
  "shunts_available": {
77
  "shunt_type_name": "DualStreamAdapter-G",
78
  "config_file_name": "config.json",
79
  "shunt_list": [
80
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e1", "file": "dual_shunt_g_laion_no_caption_e1.safetensors"},
81
+ {"name": "beatrix+clip_g-booru_v1_8h:noise-3000", "file": "dual_shunt_g_booru_no_caption_noised_e1_step_3000.safetensors"},
82
+ {"name": "beatrix+clip_g-booru_v1_8h:noise-5000", "file": "dual_shunt_g_booru_no_caption_noised_e1_step_5000.safetensors"},
83
+ {"name": "beatrix+clip_g-booru_v1_8h:noise-7000", "file": "dual_shunt_g_booru_no_caption_noised_e1_step_7000.safetensors"},
84
+ {"name": "beatrix+clip_g-booru_v1_8h:noise-10000", "file": "dual_shunt_g_booru_no_caption_noised_e1_step_10000.safetensors"},
85
+ {"name": "beatrix+clip_g-booru_v1_8h:noise-14000", "file": "dual_shunt_g_booru_no_caption_noised_e1_step_14000.safetensors"},
86
+ {"name": "beatrix+clip_g-booru_v1_8h:noise-20000", "file": "dual_shunt_g_booru_no_caption_noised_e1_step_20000.safetensors"},
87
+ {"name": "beatrix+clip_g-booru_v1_8h:noise-25000", "file": "dual_shunt_g_booru_no_caption_noised_e1_step_25000.safetensors"},
88
+ {"name": "beatrix+clip_g-booru_v1_8h:noise-30000", "file": "dual_shunt_g_booru_no_caption_noised_e1_step_30000.safetensors"},
89
+ {"name": "beatrix+clip_g-booru_v1_8h:noise-e1", "file": "dual_shunt_g_booru_no_caption_noised_e1_final.safetensors"},
90
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e2", "file": "dual_shunt_g_laion_no_caption_e2.safetensors"},
91
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e5", "file": "dual_shunt_g_laion_no_caption_e5.safetensors"},
92
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e8", "file": "dual_shunt_g_laion_no_caption_e8.safetensors"},
93
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e10", "file": "dual_shunt_g_laion_no_caption_e10.safetensors"},
94
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e12", "file": "dual_shunt_g_laion_no_caption_e12.safetensors"},
95
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e15", "file": "dual_shunt_g_laion_no_caption_e15.safetensors"},
96
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e16", "file": "dual_shunt_g_laion_no_caption_e16.safetensors"},
97
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e17", "file": "dual_shunt_g_laion_no_caption_e17.safetensors"},
98
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e18", "file": "dual_shunt_g_laion_no_caption_e18.safetensors"},
99
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e19", "file": "dual_shunt_g_laion_no_caption_e19.safetensors"},
100
+ {"name": "beatrix+clip_g-laion_v1_8h:noise-e20", "file": "dual_shunt_g_laion_no_caption_e20.safetensors"},
101
  ],
102
+ },
103
+ "config": {
104
+ "adapter_id": "006", "name": "DualShuntAdapter-G",
105
+ "condition_encoders": [{
106
+ "type": "t5_base",
107
+ "model": "AbstractPhil/bert-beatrix-2048",
108
+ "hidden_size": 768
109
+ }],
110
+ "modulation_encoders": [
111
+ {
112
+ "type": "clip_g",
113
+ "model": "laion/CLIP-ViT-bigG-14-laion2B-39B-b160k",
114
+ "hidden_size": 1280
115
+ }
116
+ ],
117
+ "hidden_size": 1280, # This is the adapter's output size
118
+ "bottleneck": 640, "heads": 8,
119
+ "max_guidance": 10.0, "tau_init": 0.1,
120
+ "proj_layers": 2, "layer_norm": True, "dropout": 0.0,
121
+ "use_dropout": False, "use_proj_stack": True, "assert_input_dims": True,
122
+ "routing": {"type": "cross_attention", "enable_causal_mask": False, "bidirectional": True},
123
+ "version": "v0.3.2"
124
+ },
125
  },
126
+ #
127
+ "clip_l_4h_bert": {
128
+ "models": ["bert-beatrix-2048", "clip_l"],
129
+ "repo": "AbstractPhil/bert-beatrix-2048-vit-l-14-dual-shunt-adapter",
130
+ "shunts_available": {
131
+ "shunt_type_name": "DualStreamAdapter-L",
132
+ "config_file_name": "config.json",
133
+ "shunt_list": [
134
+ {"name": "beatrix+clip_l-4h:noise_5000", "file": "dual_shunt_l_booru_no_caption_noised_e1_step_5000.safetensors"},
135
+ {"name": "beatrix+clip_l-4h:noise_10000", "file": "dual_shunt_l_booru_no_caption_noised_e1_step_10000.safetensors"},
136
+ {"name": "beatrix+clip_l-4h:noise_15000", "file": "dual_shunt_l_booru_no_caption_noised_e1_step_15000.safetensors"},
137
+ {"name": "beatrix+clip_l-4h:noise_20000", "file": "dual_shunt_l_booru_no_caption_noised_e1_step_20000.safetensors"},
138
+ {"name": "beatrix+clip_l-4h:noise_25000", "file": "dual_shunt_l_booru_no_caption_noised_e1_step_25000.safetensors"},
139
+ ],
140
+ },
141
+ "config": {
142
+ "adapter_id": "005",
143
+ "name": "DualShuntAdapter",
144
+ "condition_encoders": [{
145
+ "type": "bert_beatrix",
146
+ "model": "AbstractPhil/bert-beatrix-2048",
147
+ "hidden_size": 768
148
+ }],
149
+ "modulation_encoders": [{
150
+ "type": "clip_l",
151
+ "model": "openai/clip-vit-large-patch14",
152
+ "hidden_size": 768
153
+ }],
154
+ "hidden_size": 768, # This is the adapter's output size
155
+ "bottleneck": 384, "heads": 4,
156
+ "max_guidance": 10.0, "tau_init": 0.1,
157
+ "proj_layers": 2, "layer_norm": True, "dropout": 0.0,
158
+ "use_dropout": False, "use_proj_stack": True, "assert_input_dims": True,
159
+ "routing": {"type": "cross_attention", "enable_causal_mask": False, "bidirectional": True},
160
+ "version": "v0.3.2"
161
+ },
162
+ },
163
+ "clip_l_4h": {
164
  "models": ["vit-l-14", 'flan-t5-base'],
165
+ "repo": "AbstractPhil/t5-flan-base-vit-l-14-dual-stream-adapter",
166
+ "shunts_available": {
167
+ "shunt_type_name": "DualStreamAdapter-L",
168
+ "config_file_name": "config.json",
169
+ "shunt_list": [
170
+ {"name": "t5+clip_l_4h:noise_13m", "file": "t5-vit-l-14-dual_shunt_booru_13_000_000.safetensors"},
171
+ {"name": "t5+clip_l_4h:noise_51.2m", "file": "t5-vit-l-14-dual_shunt_booru_51_200_000.safetensors"}
172
+ ],
173
+ },
174
+ "config": {
175
+ "adapter_id": "003",
176
+ "name": "DualShuntAdapter",
177
+ "condition_encoders": [{
178
+ "type": "t5_base",
179
+ "model": "google/flan-t5-base",
180
+ "hidden_size": 768
181
+ }],
182
+ "modulation_encoders": [{
183
+ "type": "clip_l",
184
+ "model": "openai/clip-vit-large-patch14",
185
+ "hidden_size": 768
186
+ }],
187
+ "hidden_size": 768, # This is the adapter's output size
188
+ "bottleneck": 384, "heads": 4,
189
+ "max_guidance": 10.0, "tau_init": 0.1,
190
+ "proj_layers": 2, "layer_norm": True, "dropout": 0.0,
191
+ "use_dropout": False, "use_proj_stack": True, "assert_input_dims": True,
192
+ "routing": {"type": "cross_attention", "enable_causal_mask": False, "bidirectional": True},
193
+ "version": "v0.3.2"
194
+ },
195
+ },
196
+ "clip_l_x52": {
197
+ "models": ['bert-beatrix-2048', 'vit-l-14'],
198
+ "repo": "AbstractPhil/beatrix-x52",
199
+ "shunts_available": {
200
+ "shunt_type_name": "HarmonicBank-x52",
201
+ "config_file_name": "config.json",
202
+ "shunt_list": [
203
+ {"name": "beatrix-x52", "file": "AbstractPhil/beatrix-x52-v0001.safetensors"},
204
+ ]
205
+ },
206
+ "config": {
207
+ "adapter_id": "072",
208
+ "name": "DualShuntAdapter",
209
+ "condition_encoders": [
210
+ {
211
+ "model": "AbstractPhil/bert-beatrix-2048"
212
+ },
213
+ ],
214
+ "modulation_encoders": [
215
+ {
216
+ "model": "openai/clip-vit-large-patch14",
217
+ "offset_slip": 0.0,
218
+ "slip_frequency": 0.27
219
+ },
220
+ {
221
+ "model": "AbstractPhil/clips/Omega-SIM-ViT-CLIP_L_FP32.safetensors",
222
+ "offset_slip": 1.0,
223
+ "slip_frequency": 0.27
224
+ },
225
+ {
226
+ "model": "AbstractPhil/clips/ComfyUI_noobxl-R9_clip_l.safetensors",
227
+ "offset_slip": 2.0,
228
+ "slip_frequency": 0.27
229
+ },
230
+ {
231
+ "model": "AbstractPhil/clips/SIM-VPRED-Ω-73-clip_l.safetensors",
232
+ "offset_slip": 3.0,
233
+ "slip_frequency": 0.27
234
+ },
235
+ ],
236
+ "hidden_size": 768, # This is the adapter's output size
237
+ "resonant_heads": 2000, # number of resonant heads to distribute across the shunts
238
+ "spin": 0.5, # the spin factor that this shunt was trained on
239
+ "conv_frequency": 0.29152, # the differentiation frequency of each rope layered phase
240
+ "conv_layers": 52000, # number of convolutional layers
241
+ "use_bottleneck": False, # bottleneck can be enabled for a much more expensive overhead
242
+ "bottleneck": 32, # This is the bottleneck dim size per shunt if used
243
+ "heads": 2, # number of heads per shunt if bottleneck enabled eg 104,000 heads total which is a shitload
244
+ "max_guidance": 10.0,
245
+ "tau_init": 0.1,
246
+ "proj_layers": 16,
247
+ "layer_norm": True,
248
+ "dropout": 0.0,
249
+ "use_dropout": False,
250
+ "use_proj_stack": True,
251
+ "assert_input_dims": True,
252
+ "routing": {
253
+ "type": "phase_gate",
254
+ "math": "tau",
255
+ "rope_phase_offset": 0.0,
256
+ "omnidirectional": False,
257
+ "loosely_coupled": True,
258
+ },
259
+ "version": "v2.0.0",
260
+
261
+ },
262
+ },
263
+ "clip_l": {
264
+ "models": ['flan-t5-base', "vit-l-14"],
265
+ "repo": "AbstractPhil/t5-flan-base-vit-l-14-dual-stream-adapter",
266
  "config": {
267
  "adapter_id": "002",
268
  "name": "DualShuntAdapter",
269
+ "condition_encoders": [{
270
+ "type": "t5_base",
271
+ "model": "google/flan-t5-base",
272
+ "hidden_size": 768
273
+ }],
274
+ "modulation_encoders": [{
275
+ "type": "clip_l",
276
+ "model": "openai/clip-vit-large-patch14",
277
+ "hidden_size": 768
278
+ }],
279
  "hidden_size": 768, # This is the adapter's output size
280
  "bottleneck": 384, "heads": 12,
281
+ "max_guidance": 10.0, "tau_init": 0.1,
282
+ "proj_layers": 2, "layer_norm": True, "dropout": 0.0,
283
+ "use_dropout": False, "use_proj_stack": True, "assert_input_dims": True,
284
+ "routing": {"type": "cross_attention", "enable_causal_mask": False, "bidirectional": True},
285
+ "version": "v0.3.2"
286
+ },
287
+ "shunts_available": {
288
+ "shunt_type_name": "DualStreamAdapter-L",
289
+ "config_file_name": "config.json",
290
+ "shunt_list": [
291
+ {"name": "t5+clip_l_12h:caption-20m", "file": "t5-vit-l-14-dual_shunt_caption.safetensors" },
292
+ {"name": "t5+clip_l_12h:noise-20m", "file": "t5-vit-l-14-dual_shunt_no_caption.safetensors" },
293
+ {"name": "t5+clip_l_12h:summarize-20m", "file": "t5-vit-l-14-dual_shunt_summarize.safetensors" },
294
+ ],
295
+ },
296
+ },
297
+ #AbstractPhil/bert-beatrix-2048-noobxl-epsilon-v11-dual-shunt-adapter_clip_g
298
+ "clip_g_noob": {
299
+ "models": ['bert-beatrix-2048', "clip_g"],
300
+ "repo": "AbstractPhil/bert-beatrix-2048-noobxl-epsilon-v11-dual-shunt-adapter_clip_g",
301
+ "config": {
302
+ "adapter_id": "006",
303
+ "name": "DualShuntAdapter",
304
+ "condition_encoders": [{
305
+ "type": "bert_beatrix",
306
+ "model": "AbstractPhil/bert-beatrix-2048",
307
+ "hidden_size": 768
308
+ }],
309
+ "modulation_encoders": [{
310
+ "type": "clip_g",
311
+ "model": "AbstractPhil/clips/NAI-11-epsilon_clip_g.safetensors",
312
+ "hidden_size": 1280
313
+ }],
314
+ "hidden_size": 1280, # This is the adapter's output size
315
+ "bottleneck": 640, "heads": 8,
316
+ "max_guidance": 10.0, "tau_init": 0.1,
317
+ "proj_layers": 2, "layer_norm": True, "dropout": 0.0,
318
+ "use_dropout": False, "use_proj_stack": True, "assert_input_dims": True,
319
+ "routing": {"type": "cross_attention", "enable_causal_mask": False, "bidirectional": True},
320
+ "version": "v0.3.2"
321
+ },
322
+ "shunts_available": {
323
+ "shunt_type_name": "DualStreamAdapter-G",
324
+ "config_file_name": "config.json",
325
+ "shunt_list": [
326
+ {"name": "beatrix+noob_g_8h:noised-1000", "file": "dual_shunt_g_noob_no_caption_e1_step_1000.safetensors"},
327
+ {"name": "beatrix+noob_g_8h:noised-2000", "file": "dual_shunt_g_noob_no_caption_e1_step_2000.safetensors"},
328
+ {"name": "beatrix+noob_g_8h:noised-3000", "file": "dual_shunt_g_noob_no_caption_e1_step_3000.safetensors"},
329
+ {"name": "beatrix+noob_g_8h:noised-4000", "file": "dual_shunt_g_noob_no_caption_e1_step_4000.safetensors"},
330
+ {"name": "beatrix+noob_g_8h:noised-5000", "file": "dual_shunt_g_noob_no_caption_e1_step_5000.safetensors"},
331
+ {"name": "beatrix+noob_g_8h:noised-6000", "file": "dual_shunt_g_noob_no_caption_e1_step_6000.safetensors"},
332
+ {"name": "beatrix+noob_g_8h:noised-7000", "file": "dual_shunt_g_noob_no_caption_e1_step_7000.safetensors"},
333
+ {"name": "beatrix+noob_g_8h:noised-8000", "file": "dual_shunt_g_noob_no_caption_e1_step_8000.safetensors"},
334
+ ]
335
+ },
336
+ },
337
+
338
+
339
+ "clip_l_noob": {
340
+ "models": ['bert-beatrix-2048', "vit-l-14"],
341
+ "repo": "AbstractPhil/bert-beatrix-2048-noobxl-epsilon-v11-dual-shunt-adapter",
342
+ "config": {
343
+ "adapter_id": "002",
344
+ "name": "DualShuntAdapter",
345
+ "condition_encoders": [{
346
+ "type": "bert_beatrix",
347
+ "model": "AbstractPhil/bert-beatrix-2048",
348
+ "hidden_size": 768
349
+ }],
350
+ "modulation_encoders": [{
351
+ "type": "clip_l",
352
+ "model": "AbstractPhil/clips/NAI-11-epsilon_clip_l.safetensors",
353
+ "hidden_size": 768
354
+ }],
355
+ "hidden_size": 768, # This is the adapter's output size
356
+ "bottleneck": 384, "heads": 4,
357
+ "max_guidance": 10.0, "tau_init": 0.1,
358
+ "proj_layers": 2, "layer_norm": True, "dropout": 0.0,
359
+ "use_dropout": False, "use_proj_stack": True, "assert_input_dims": True,
360
  "routing": {"type": "cross_attention", "enable_causal_mask": False, "bidirectional": True},
361
  "version": "v0.3.2"
362
  },
 
363
  "shunts_available": {
364
  "shunt_type_name": "DualStreamAdapter-L",
365
  "config_file_name": "config.json",
366
  "shunt_list": [
367
+ {"name": "beatrix+noob_l_4h:noise-5000", "file": "beatrix_dual_shunt_l_noob_e1_step_5000.safetensors"},
368
+ {"name": "beatrix+noob_l_4h:noise-10000", "file": "beatrix_dual_shunt_l_noob_e1_step_10000.safetensors"},
369
+ {"name": "beatrix+noob_l_4h:noise-15000", "file": "beatrix_dual_shunt_l_noob_e1_step_15000.safetensors"},
370
+ {"name": "beatrix+noob_l_4h:noise-20000", "file": "beatrix_dual_shunt_l_noob_e1_step_20000.safetensors"},
371
+ {"name": "beatrix+noob_l_4h:noise-25000", "file": "beatrix_dual_shunt_l_noob_e1_step_25000.safetensors"},
372
+ {"name": "beatrix+noob_l_4h:noise-30000", "file": "beatrix_dual_shunt_l_noob_e1_step_30000.safetensors"},
373
+ {"name": "beatrix+noob_l_4h:noise-35000", "file": "beatrix_dual_shunt_l_noob_e1_step_35000.safetensors"},
374
+ {"name": "beatrix+noob_l_4h:noise-40000", "file": "beatrix_dual_shunt_l_noob_e1_step_40000.safetensors"},
375
+ {"name": "beatrix+noob_l_4h:noise-45000", "file": "beatrix_dual_shunt_l_noob_e1_step_45000.safetensors"},
376
+ {"name": "beatrix+noob_l_4h:noise-50000", "file": "beatrix_dual_shunt_l_noob_e1_step_50000.safetensors"},
377
+ {"name": "beatrix+noob_l_4h:noise-55000", "file": "beatrix_dual_shunt_l_noob_e1_step_55000.safetensors"},
378
+ {"name": "beatrix+noob_l_4h:noise-60000", "file": "beatrix_dual_shunt_l_noob_e1_step_60000.safetensors"},
379
+ {"name": "beatrix+noob_l_4h:noise-65000", "file": "beatrix_dual_shunt_l_noob_e1_step_65000.safetensors"},
380
+ {"name": "beatrix+noob_l_4h:noise-70000", "file": "beatrix_dual_shunt_l_noob_e1_step_70000.safetensors"},
381
+ {"name": "beatrix+noob_l_4h:noise-75000", "file": "beatrix_dual_shunt_l_noob_e1_step_75000.safetensors"},
382
+ {"name": "beatrix+noob_l_4h:noise-80000", "file": "beatrix_dual_shunt_l_noob_e1_step_80000.safetensors"},
383
+ {"name": "beatrix+noob_l_4h:noise-85000", "file": "beatrix_dual_shunt_l_noob_e1_step_85000.safetensors"},
384
+ {"name": "beatrix+noob_l_4h:noise-90000", "file": "beatrix_dual_shunt_l_noob_e1_step_90000.safetensors"},
385
+ {"name": "beatrix+noob_l_4h:noise-100000", "file": "beatrix_dual_shunt_l_noob_e1_step_100000.safetensors"},
386
+ {"name": "beatrix+noob_l_4h:noise-120000", "file": "beatrix_dual_shunt_l_noob_e1_step_120000.safetensors"},
387
+ {"name": "beatrix+noob_l_4h:noise-140000", "file": "beatrix_dual_shunt_l_noob_e1_step_140000.safetensors"},
388
+ {"name": "beatrix+noob_l_4h:noise-150000", "file": "beatrix_dual_shunt_l_noob_e1_step_150000.safetensors"},
389
+ {"name": "beatrix+noob_l_4h:noise-160000", "file": "beatrix_dual_shunt_l_noob_e1_step_160000.safetensors"},
390
+ {"name": "beatrix+noob_l_4h:noise-180000", "file": "beatrix_dual_shunt_l_noob_e1_step_180000.safetensors"},
391
+ {"name": "beatrix+noob_l_4h:noise-200000", "file": "beatrix_dual_shunt_l_noob_e1_step_200000.safetensors"},
392
+ {"name": "beatrix+noob_l_4h:noise-225000", "file": "beatrix_dual_shunt_l_noob_e1_step_225000.safetensors"},
393
+ {"name": "beatrix+noob_l_4h:noise-250000", "file": "beatrix_dual_shunt_l_noob_e1_step_250000.safetensors"},
394
+ {"name": "beatrix+noob_l_4h:noise-275000", "file": "beatrix_dual_shunt_l_noob_e1_step_275000.safetensors"},
395
+ {"name": "beatrix+noob_l_4h:noise-300000", "file": "beatrix_dual_shunt_l_noob_e1_step_300000.safetensors"},
396
+ {"name": "beatrix+noob_l_4h:noise-310000", "file": "beatrix_dual_shunt_l_noob_e1_step_310000.safetensors"},
397
+ {"name": "beatrix+noob_l_4h:noise-314000", "file": "beatrix_dual_shunt_l_noob_e1_step_314000.safetensors"},
398
  ],
399
  },
400
  }
 
402
 
403
  # ─── Adapter Configs ─────────────────────────────────────────────
404
 
405
+ ENCODER_CONFIGS = {
406
+ "bert-beatrix-2048": {
407
+ "repo_name": "AbstractPhil/bert-beatrix-2048",
408
+ "name": "bert-beatrix-2048",
409
+ "type": "nomic_bert",
410
+ "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
411
+ "use_remote_code": True,
412
+ "subfolder": "",
413
+ },
414
+ "nomic-bert-2048": {
415
+ "repo_name": "nomic-ai/nomic-bert-2048",
416
+ "name": "nomic-bert-2048",
417
+ "type": "nomic_bert",
418
+ "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
419
+ "use_remote_code": True,
420
+ "subfolder": "",
421
+ },
422
  "mobilebert-base-uncased": {
423
  "repo_name": "google/mobilebert-uncased",
424
+ "name": "mobilebert-base-uncased",
425
+ "type": "mobilebert",
426
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
427
  "subfolder": "",
428
  },
429
  "bert-base-uncased": {
430
  "repo_name": "bert-base-uncased",
431
+ "name": "bert-base-uncased",
432
+ "type": "bert",
433
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
434
  },
435
  "bert-large-uncased": {
436
  "repo_name": "bert-large-uncased",
437
+ "name": "bert-large-uncased",
438
+ "type": "bert",
439
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
440
  },
441
  "bert-base-cased": {
442
  "repo_name": "bert-base-cased",
443
+ "name": "bert-base-cased",
444
+ "type": "bert",
445
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
446
+ },
447
+ "bert-large-cased": {
448
+ "repo_name": "google-bert/bert-large-cased",
449
+ "name": "bert-large-cased",
450
+ "type": "bert",
451
+ "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
452
+ },
453
+ "bert-base-multilingual-cased": {
454
+ "repo_name": "google-bert/bert-base-multilingual-cased",
455
+ "name": "bert-base-multilingual-cased",
456
+ "type": "bert",
457
+ "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
458
+ },
459
+ "t5xxl": {
460
+ "repo_name": "google/t5-xxl-lm-adapt",
461
+ "name": "t5-xxl",
462
+ "type": "t5",
463
+ "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
464
+ "subfolder": "",
465
+ },
466
+ "distill-t5-base-4096": {
467
+ "repo_name": "LifuWang/DistillT5",
468
+ "name": "distill-t5-base-4096",
469
+ "type": "t5_encoder_with_projection",
470
+ "tokenizer": "t5_override", # only required if the tokenizer is missing from the model repo
471
+ "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
472
+ "subfolder": "",
473
+ },
474
+ "distill-t5-small-4096": {
475
+ "repo_name": "LifuWang/DistillT5-Small",
476
+ "name": "distill-t5-small-4096",
477
+ "type": "t5_encoder_with_projection",
478
+ "tokenizer": "t5_override", # only required if the tokenizer is missing from the model repo
479
+ "use_huggingface": True,
480
+ # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
481
+ "subfolder": "",
482
+ },
483
+ "distill-t5-large-4096": {
484
+ "repo_name": "LifuWang/DistillT5-Large",
485
+ "name": "distill-t5-large-4096",
486
+ "type": "t5_encoder_with_projection",
487
+ "tokenizer": "t5_override", # only required if the tokenizer is missing from the model repo
488
+ "use_huggingface": True,
489
+ # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
490
+ "subfolder": "",
491
+ },
492
 
493
+ "t5xxl-unchained": {
494
+ "repo_name": "AbstractPhil/t5xxl-unchained",
495
+ "name": "t5xxl-unchained-f16",
496
+ "type": "t5",
497
+ "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
498
+ "subfolder": "",
499
+ #"tokenizer": "t5-unchained",
500
+ "file_name": "t5xxl-unchained-f16.safetensors",
501
+ "config": {
502
+ "config_file_name": "config.json",
503
+ "architectures": [
504
+ "T5ForConditionalGeneration"
505
+ ],
506
+ "attention_dropout": 0.0,
507
+ "classifier_dropout": 0.0,
508
+
509
+ "d_ff": 10240,
510
+ "d_kv": 64,
511
+ "d_model": 4096,
512
+ "decoder_start_token_id": 0,
513
+ "dropout_rate": 0.0,
514
+ "eos_token_id": 1,
515
+ "dense_act_fn": "gelu_pytorch_tanh",
516
+ "initializer_factor": 1.0,
517
+ "is_encoder_decoder": True,
518
+ "is_gated_act": True,
519
+ "layer_norm_epsilon": 1e-06,
520
+ "model_type": "t5",
521
+ "num_decoder_layers": 24,
522
+ "num_heads": 64,
523
+ "num_layers": 24,
524
+ "output_past": True,
525
+ "pad_token_id": 0,
526
+ "relative_attention_num_buckets": 32,
527
+ "tie_word_embeddings": False,
528
+ "vocab_size": 69328,
529
+ }
530
+ },
531
+ "flan-t5-small": {
532
+ "repo_name": "google/flan-t5-small",
533
+ "name": "flan-t5-small",
534
+ "type": "t5",
535
+ "use_huggingface": True,
536
+ # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
537
+ },
538
  "flan-t5-base": {
539
  "repo_name": "google/flan-t5-base",
540
+ "name": "flan-t5-base",
541
+ "type": "t5",
542
+ "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
543
+ },
544
+ "flan-t5-large": {
545
+ "repo_name": "google/flan-t5-large",
546
+ "name": "flan-t5-large",
547
+ "type": "t5",
548
+ "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
549
+ },
550
+ "flan-t5-xl": {
551
+ "repo_name": "google/flan-t5-xl",
552
+ "name": "flan-t5-xl",
553
+ "type": "t5",
554
+ "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
555
+ },
556
+ "flan-t5-xxl": {
557
+ "repo_name": "google/flan-t5-xxl",
558
+ "name": "flan-t5-xxl",
559
+ "type": "t5",
560
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
561
  },
562
  "t5-small": {
563
  "repo_name": "google-t5/t5-small",
564
+ "name": "t5-small",
565
+ "type": "t5",
566
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
 
567
  },
568
  "t5_small_human_attentive_try2_pass3": {
569
+ "repo_name": "AbstractPhil/T5-Small-Human-Attentive-Try2-Pass3",
570
+ "name": "t5_small_human_attentive_try2_pass3",
571
+ "type": "t5",
572
  "use_huggingface": True, # defaults to simple loading from HuggingFace, if False, will use repo_name and subfolder
573
  # the necessary config is present here for posterity in case it fails to load from HuggingFace.
574
  "subfolder": "",
 
579
  "architectures": [
580
  "T5ForConditionalGeneration"
581
  ],
582
+ "attention_dropout": 0.0,
583
  "classifier_dropout": 0.0,
584
  "d_ff": 2048,
585
  "d_kv": 64,
 
617
  "vocab_size": 32128
618
  }
619
  }
620
+ }
621
+
622
+
623
+ # load these shunts in groups with types
624
+ GROUPED_SHUNTS = {
625
+ # these are automatically loaded by the simple shunt organizer
626
+ # for sdxl, they should have clip_l and clip_g
627
+ # for flux, they should have clip_l or t5xxl or t5-unchained
628
+ # for hidream, they can have clip_l, t5xxl, t5-unchained, or flan-t5-base, or llama - but llama isn't ready yet
629
+ "beatrix": {
630
+ "booru_sdxl_x2": [
631
+ # clip_l heavy using 4 head shunts
632
+ "beatrix+clip_l-4h:noise_25000",
633
+ "beatrix+clip_g-booru_v1_8h:noise-30000"
634
+ ],
635
+ "noob_sdxl_x2": [
636
+ # clip_l heavy using 4 head shunts
637
+ "beatrix+noob_g_8h:noised-8000",
638
+ "beatrix+noob_l_4h:noise-314000",
639
+ ],
640
+ "booru_": [
641
+ ],
642
+ },
643
+ "flan-t5-base": {
644
+ "booru_sdxl_12h": [
645
+ ]
646
+
647
+ }
648
+
649
+ }
650
+
651
+
652
+
653
+ SHUNT_DATAS: list[ShuntData] = []
654
+ """
655
+ Populates the shunts list with available shunts from all the shunt dictionaries.
656
+ """
657
+
658
+ ENCODER_DATAS: list[EncoderData] = []
659
+
660
+
661
+ class EncoderData:
662
+ """
663
+ Represents an encoder configuration with its associated properties.
664
+ """
665
+ def __init__(self,
666
+ name: str,
667
+ file: str,
668
+ repo: str,
669
+ config: dict,
670
+ type: Optional[str] = "t5",
671
+ tokenizer: Optional[str] = ""):
672
+ self.name = name
673
+ self.file = file
674
+ self.repo = repo
675
+ self.config = config
676
+ self.type = type
677
+ self.tokenizer = tokenizer
678
+
679
+ for encoder_dict in ENCODER_CONFIGS.values():
680
+ if "repo_name" in encoder_dict:
681
+ repo_name = encoder_dict["repo_name"]
682
+ file_name = encoder_dict.get("file_name", "")
683
+ # populate the encoders list with a reference to the encoder dictionary
684
+ ENCODER_DATAS.append(EncoderData(
685
+ name=encoder_dict["name"],
686
+ file=file_name,
687
+ repo=repo_name, # repo_name is the HuggingFace repo name
688
+ tokenizer=encoder_dict.get("tokenizer", ""), # empty means use the default repo tokenizer, none found fails
689
+ config=encoder_dict.get("config", {}),
690
+ type=encoder_dict.get("type", "unknown")
691
+ ))
692
+
693
+ class ShuntData:
694
+ """
695
+ Represents a shunt configuration with its associated properties.
696
+ """
697
+
698
+ def __init__(self, name: str, file: str, repo: str, config: dict, expected: list[str], modulation_encoders: list[dict], condition_encoders: list[dict], shunt_type_name: str, config_file_name: str):
699
+ self.name = name
700
+ self.file = file
701
+ self.repo = repo
702
+ self.config = config
703
+ self.expected = expected
704
+ self.modulation_encoders = modulation_encoders
705
+ self.condition_encoders = condition_encoders
706
+ self.shunt_type_name = shunt_type_name
707
+ self.config_file_name = config_file_name
708
+
709
+
710
+ for shunt_dict in HARMONIC_SHUNT_REPOS.values():
711
+ if "shunts_available" in shunt_dict:
712
+ shunts = shunt_dict["shunts_available"]["shunt_list"]
713
+ for shunt in shunts:
714
+ name, file_name = shunt.get("name"), shunt.get("file")
715
+ # populate the shunts list with a reference to the shunt dictionary
716
+ SHUNT_DATAS.append(ShuntData(
717
+ name=name,
718
+ file=file_name,
719
+ repo=shunt_dict["repo"],
720
+ config=shunt_dict["config"],
721
+ expected=shunt_dict["models"],
722
+ modulation_encoders=shunt_dict["config"]["modulation_encoders"],
723
+ condition_encoders=shunt_dict["config"]["condition_encoders"],
724
+ shunt_type_name=shunt_dict["shunts_available"]["shunt_type_name"],
725
+ config_file_name=shunt_dict["shunts_available"]["config_file_name"]
726
+ ))
727
+
728
+
729
+
730
+ class ShuntUtil:
731
+
732
+ @staticmethod
733
+ def get_encoder_by_model_name(model_name: str) -> Optional[EncoderData]:
734
+ """
735
+ Returns the encoder configuration dictionary by its model name.
736
+ Args:
737
+ model_name (str): The name of the model to retrieve.
738
+
739
+ Returns:
740
+ Optional[EncoderData]: The encoder configuration dictionary if found, otherwise None.
741
+ """
742
+ logger.info(f"Searching for encoder with model name: {model_name}")
743
+ logger.info(f"Available encoders: {[encoder.name for encoder in ENCODER_DATAS]}")
744
+ for encoder in ENCODER_DATAS:
745
+ logger.info(f"Checking encoder: {encoder.name} against model name: {model_name}")
746
+ if encoder.name == model_name:
747
+ return encoder
748
+ logger.warning(f"Encoder '{model_name}' not found.")
749
+ return None
750
+
751
+ @staticmethod
752
+ def get_encoder_repos_by_shunt_name(shunt_name: str) -> list[str]:
753
+ """
754
+ Returns the repository name of the encoder associated with the given shunt name.
755
+
756
+ Args:
757
+ shunt_name (str): The name of the shunt to search for.
758
+
759
+ Returns:
760
+ Optional[str]: The repository name if found, otherwise None.
761
+ """
762
+ shunt = ShuntUtil.get_shunt_by_name(shunt_name)
763
+ prepared = []
764
+ if shunt:
765
+ for model in shunt["expected"]:
766
+ if model in DEFAULT_REPOS:
767
+ prepared.append(DEFAULT_REPOS[model])
768
+ else:
769
+
770
+ logger.warning(f"Model '{model}' not found in default repositories.")
771
+ return prepared
772
+ else:
773
+ logger.warning(f"Shunt '{shunt_name}' not found.")
774
+
775
+ return None
776
+
777
+ @staticmethod
778
+ def get_shunt_by_name(name: str) -> Optional[ShuntData]:
779
+ """
780
+ Returns the shunt configuration dictionary by its name.
781
+
782
+ Args:
783
+ name (str): The name of the shunt to retrieve.
784
+
785
+ Returns:
786
+ Optional[dict]: The shunt configuration dictionary if found, otherwise None.
787
+ """
788
+ for shunt in SHUNT_DATAS:
789
+ if shunt.name == name:
790
+ return shunt
791
+ logger.warning(f"Shunt '{name}' not found.")
792
+ return None
793
+
794
+ @staticmethod
795
+ def get_shunt_names() -> list[str]:
796
+ """
797
+ Returns a list of all available shunt names.
798
+
799
+ Returns:
800
+ list[str]: List of shunt names.
801
+ """
802
+ return [shunt.name for shunt in SHUNT_DATAS]
803
+