Upload model
Browse files- config.json +3 -161
- configuration_cxrmate_ed.py +36 -7
- model.safetensors +1 -1
config.json
CHANGED
@@ -6,194 +6,36 @@
|
|
6 |
"AutoModel": "modelling_cxrmate_ed.CXRMateEDModel"
|
7 |
},
|
8 |
"decoder": {
|
9 |
-
"_name_or_path": "",
|
10 |
-
"add_cross_attention": false,
|
11 |
"add_time_deltas": true,
|
12 |
-
"architectures": null,
|
13 |
-
"attention_bias": false,
|
14 |
-
"attention_dropout": 0.0,
|
15 |
-
"bad_words_ids": null,
|
16 |
-
"begin_suppress_tokens": null,
|
17 |
-
"bos_token_id": 1,
|
18 |
-
"chunk_size_feed_forward": 0,
|
19 |
-
"cross_attention_hidden_size": null,
|
20 |
-
"decoder_start_token_id": null,
|
21 |
-
"diversity_penalty": 0.0,
|
22 |
-
"do_sample": false,
|
23 |
-
"early_stopping": false,
|
24 |
-
"encoder_no_repeat_ngram_size": 0,
|
25 |
-
"eos_token_id": 2,
|
26 |
-
"exponential_decay_length_penalty": null,
|
27 |
-
"finetuning_task": null,
|
28 |
-
"forced_bos_token_id": null,
|
29 |
-
"forced_eos_token_id": null,
|
30 |
-
"hidden_act": "silu",
|
31 |
"hidden_size": 768,
|
32 |
"history": 0,
|
33 |
-
"id2label": {
|
34 |
-
"0": "LABEL_0",
|
35 |
-
"1": "LABEL_1"
|
36 |
-
},
|
37 |
"include_time_delta": true,
|
38 |
"index_value_encoder_intermediate_size": 2048,
|
39 |
-
"initializer_range": 0.02,
|
40 |
"intermediate_size": 3072,
|
41 |
"is_decoder": true,
|
42 |
-
"is_encoder_decoder": false,
|
43 |
-
"label2id": {
|
44 |
-
"LABEL_0": 0,
|
45 |
-
"LABEL_1": 1
|
46 |
-
},
|
47 |
-
"length_penalty": 1.0,
|
48 |
-
"max_length": 20,
|
49 |
-
"max_position_embeddings": 2048,
|
50 |
-
"min_length": 0,
|
51 |
"model_type": "llama",
|
52 |
-
"no_repeat_ngram_size": 0,
|
53 |
"num_attention_heads": 12,
|
54 |
-
"num_beam_groups": 1,
|
55 |
-
"num_beams": 1,
|
56 |
"num_hidden_layers": 6,
|
57 |
"num_key_value_heads": 12,
|
58 |
-
"num_return_sequences": 1,
|
59 |
-
"output_attentions": false,
|
60 |
-
"output_hidden_states": false,
|
61 |
-
"output_scores": false,
|
62 |
"pad_token_id": 4,
|
63 |
-
"prefix": null,
|
64 |
-
"pretraining_tp": 1,
|
65 |
-
"problem_type": null,
|
66 |
"prompt_report_sections_filter": [
|
67 |
"indication",
|
68 |
"history"
|
69 |
],
|
70 |
-
"pruned_heads": {},
|
71 |
-
"remove_invalid_values": false,
|
72 |
-
"repetition_penalty": 1.0,
|
73 |
-
"return_dict": true,
|
74 |
-
"return_dict_in_generate": false,
|
75 |
-
"rms_norm_eps": 1e-06,
|
76 |
-
"rope_scaling": null,
|
77 |
-
"rope_theta": 10000.0,
|
78 |
-
"sep_token_id": null,
|
79 |
-
"suppress_tokens": null,
|
80 |
"tables_filter": [
|
81 |
"mimic_cxr_sectioned",
|
82 |
"triage",
|
83 |
"medrecon"
|
84 |
],
|
85 |
-
"task_specific_params": null,
|
86 |
-
"temperature": 1.0,
|
87 |
-
"tf_legacy_loss": false,
|
88 |
-
"tie_encoder_decoder": false,
|
89 |
-
"tie_word_embeddings": false,
|
90 |
"time_delta_monotonic_inversion": true,
|
91 |
-
"tokenizer_class": null,
|
92 |
-
"top_k": 50,
|
93 |
-
"top_p": 1.0,
|
94 |
-
"torch_dtype": null,
|
95 |
-
"torchscript": false,
|
96 |
-
"typical_p": 1.0,
|
97 |
-
"use_bfloat16": false,
|
98 |
-
"use_cache": true,
|
99 |
"vocab_size": 30000
|
100 |
},
|
101 |
"encoder": {
|
102 |
-
"_name_or_path": "",
|
103 |
-
"add_cross_attention": false,
|
104 |
-
"architectures": null,
|
105 |
-
"attn_drop_rate": 0.0,
|
106 |
-
"bad_words_ids": null,
|
107 |
-
"begin_suppress_tokens": null,
|
108 |
-
"bos_token_id": null,
|
109 |
-
"chunk_size_feed_forward": 0,
|
110 |
-
"conv_stem": false,
|
111 |
-
"cross_attention_hidden_size": null,
|
112 |
-
"decoder_start_token_id": null,
|
113 |
-
"depth": [
|
114 |
-
5,
|
115 |
-
8,
|
116 |
-
20,
|
117 |
-
7
|
118 |
-
],
|
119 |
-
"diversity_penalty": 0.0,
|
120 |
-
"do_sample": false,
|
121 |
-
"drop_path_rate": 0.3,
|
122 |
-
"drop_rate": 0.0,
|
123 |
-
"early_stopping": false,
|
124 |
-
"embed_dim": [
|
125 |
-
64,
|
126 |
-
128,
|
127 |
-
320,
|
128 |
-
512
|
129 |
-
],
|
130 |
-
"encoder_no_repeat_ngram_size": 0,
|
131 |
-
"eos_token_id": null,
|
132 |
-
"exponential_decay_length_penalty": null,
|
133 |
-
"finetuning_task": null,
|
134 |
-
"forced_bos_token_id": null,
|
135 |
-
"forced_eos_token_id": null,
|
136 |
-
"head_dim": 64,
|
137 |
-
"id2label": {
|
138 |
-
"0": "LABEL_0",
|
139 |
-
"1": "LABEL_1"
|
140 |
-
},
|
141 |
-
"image_size": 384,
|
142 |
-
"in_chans": 3,
|
143 |
-
"is_decoder": false,
|
144 |
-
"is_encoder_decoder": false,
|
145 |
-
"label2id": {
|
146 |
-
"LABEL_0": 0,
|
147 |
-
"LABEL_1": 1
|
148 |
-
},
|
149 |
-
"layer_norm_eps": 1e-06,
|
150 |
-
"length_penalty": 1.0,
|
151 |
-
"max_length": 20,
|
152 |
-
"min_length": 0,
|
153 |
-
"mlp_ratio": 4,
|
154 |
"model_type": "vit",
|
155 |
-
"
|
156 |
-
"num_beam_groups": 1,
|
157 |
-
"num_beams": 1,
|
158 |
-
"num_classes": 1000,
|
159 |
-
"num_return_sequences": 1,
|
160 |
-
"output_attentions": false,
|
161 |
-
"output_hidden_states": false,
|
162 |
-
"output_scores": false,
|
163 |
-
"pad_token_id": null,
|
164 |
-
"patch_size": [
|
165 |
-
4,
|
166 |
-
2,
|
167 |
-
2,
|
168 |
-
2
|
169 |
-
],
|
170 |
-
"prefix": null,
|
171 |
-
"problem_type": null,
|
172 |
-
"projection_size": 768,
|
173 |
-
"pruned_heads": {},
|
174 |
-
"qk_scale": null,
|
175 |
-
"qkv_bias": true,
|
176 |
-
"remove_invalid_values": false,
|
177 |
-
"repetition_penalty": 1.0,
|
178 |
-
"representation_size": null,
|
179 |
-
"return_dict": true,
|
180 |
-
"return_dict_in_generate": false,
|
181 |
-
"sep_token_id": null,
|
182 |
-
"suppress_tokens": null,
|
183 |
-
"task_specific_params": null,
|
184 |
-
"temperature": 1.0,
|
185 |
-
"tf_legacy_loss": false,
|
186 |
-
"tie_encoder_decoder": false,
|
187 |
-
"tie_word_embeddings": true,
|
188 |
-
"tokenizer_class": null,
|
189 |
-
"top_k": 50,
|
190 |
-
"top_p": 1.0,
|
191 |
-
"torch_dtype": null,
|
192 |
-
"torchscript": false,
|
193 |
-
"typical_p": 1.0,
|
194 |
-
"use_bfloat16": false
|
195 |
},
|
196 |
-
"
|
|
|
197 |
"tie_word_embeddings": false,
|
198 |
"torch_dtype": "float32",
|
199 |
"transformers_version": "4.39.3"
|
|
|
6 |
"AutoModel": "modelling_cxrmate_ed.CXRMateEDModel"
|
7 |
},
|
8 |
"decoder": {
|
|
|
|
|
9 |
"add_time_deltas": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
"hidden_size": 768,
|
11 |
"history": 0,
|
|
|
|
|
|
|
|
|
12 |
"include_time_delta": true,
|
13 |
"index_value_encoder_intermediate_size": 2048,
|
|
|
14 |
"intermediate_size": 3072,
|
15 |
"is_decoder": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
"model_type": "llama",
|
|
|
17 |
"num_attention_heads": 12,
|
|
|
|
|
18 |
"num_hidden_layers": 6,
|
19 |
"num_key_value_heads": 12,
|
|
|
|
|
|
|
|
|
20 |
"pad_token_id": 4,
|
|
|
|
|
|
|
21 |
"prompt_report_sections_filter": [
|
22 |
"indication",
|
23 |
"history"
|
24 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
"tables_filter": [
|
26 |
"mimic_cxr_sectioned",
|
27 |
"triage",
|
28 |
"medrecon"
|
29 |
],
|
|
|
|
|
|
|
|
|
|
|
30 |
"time_delta_monotonic_inversion": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
"vocab_size": 30000
|
32 |
},
|
33 |
"encoder": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
"model_type": "vit",
|
35 |
+
"projection_size": 768
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
},
|
37 |
+
"is_encoder_decoder": false,
|
38 |
+
"model_type": "vision-encoder-decoder",
|
39 |
"tie_word_embeddings": false,
|
40 |
"torch_dtype": "float32",
|
41 |
"transformers_version": "4.39.3"
|
configuration_cxrmate_ed.py
CHANGED
@@ -1,23 +1,52 @@
|
|
|
|
1 |
from transformers.configuration_utils import PretrainedConfig
|
2 |
from transformers.utils import logging
|
3 |
|
|
|
|
|
4 |
logger = logging.get_logger(__name__)
|
5 |
|
6 |
|
7 |
class CXRMateEDConfig(PretrainedConfig):
|
8 |
|
9 |
-
model_type = "
|
10 |
|
11 |
def __init__(self, **kwargs):
|
12 |
super().__init__(**kwargs)
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
self.encoder = kwargs.pop("encoder")
|
20 |
-
self.decoder = kwargs.pop("decoder")
|
21 |
self.is_encoder_decoder = True
|
22 |
|
23 |
@classmethod
|
|
|
1 |
+
import transformers
|
2 |
from transformers.configuration_utils import PretrainedConfig
|
3 |
from transformers.utils import logging
|
4 |
|
5 |
+
from .configuration_uniformer import UniFormerWithProjectionHeadConfig
|
6 |
+
|
7 |
logger = logging.get_logger(__name__)
|
8 |
|
9 |
|
10 |
class CXRMateEDConfig(PretrainedConfig):
|
11 |
|
12 |
+
model_type = "vision-encoder-decoder"
|
13 |
|
14 |
def __init__(self, **kwargs):
|
15 |
super().__init__(**kwargs)
|
16 |
+
|
17 |
+
if 'decoder' not in kwargs:
|
18 |
+
|
19 |
+
self.decoder = transformers.LlamaConfig(
|
20 |
+
vocab_size=30000,
|
21 |
+
hidden_size=768,
|
22 |
+
intermediate_size=3072,
|
23 |
+
num_attention_heads=12,
|
24 |
+
num_hidden_layers=6,
|
25 |
+
max_position_embeddings=2048,
|
26 |
)
|
27 |
+
self.decoder.is_decoder = True
|
28 |
+
|
29 |
+
self.decoder.index_value_encoder_intermediate_size = 2048
|
30 |
+
self.decoder.include_time_delta = True
|
31 |
+
self.decoder.time_delta_monotonic_inversion = True
|
32 |
+
self.decoder.add_time_deltas = True
|
33 |
+
self.decoder.history = 0
|
34 |
+
self.decoder.tables_filter = ["mimic_cxr_sectioned", "triage", "medrecon"]
|
35 |
+
self.decoder.prompt_report_sections_filter = ["indication", "history"]
|
36 |
+
self.decoder.pad_token_id = 4
|
37 |
+
|
38 |
+
else:
|
39 |
+
self.decoder = kwargs.pop("decoder")
|
40 |
+
|
41 |
+
|
42 |
+
if 'encoder' not in kwargs:
|
43 |
+
self.encoder = UniFormerWithProjectionHeadConfig(
|
44 |
+
projection_size=768,
|
45 |
+
)
|
46 |
+
else:
|
47 |
+
self.encoder = kwargs.pop("encoder")
|
48 |
+
|
49 |
|
|
|
|
|
50 |
self.is_encoder_decoder = True
|
51 |
|
52 |
@classmethod
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 789958760
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dcee4d15b3c57def6d5179226c24381cf47f84ab19e3ed567b97dcce2e8804f5
|
3 |
size 789958760
|