anicolson commited on
Commit
40d4936
1 Parent(s): dfdedc0

Upload model

Browse files
config.json CHANGED
@@ -7,7 +7,6 @@
7
  "AutoConfig": "configuration_cxrmate_ed.CXRMateEDConfig",
8
  "AutoModelForCausalLM": "modelling_cxrmate_ed.CXRMateEDModel"
9
  },
10
- "hidden_size": 768,
11
  "history": 0,
12
  "include_time_delta": true,
13
  "index_value_encoder_intermediate_size": 2048,
 
7
  "AutoConfig": "configuration_cxrmate_ed.CXRMateEDConfig",
8
  "AutoModelForCausalLM": "modelling_cxrmate_ed.CXRMateEDModel"
9
  },
 
10
  "history": 0,
11
  "include_time_delta": true,
12
  "index_value_encoder_intermediate_size": 2048,
configuration_cxrmate_ed.py CHANGED
@@ -62,10 +62,7 @@ class CXRMateEDConfig(transformers.PretrainedConfig):
62
  self.history = history
63
  self.tables_filter = tables_filter
64
  self.prompt_report_sections_filter = prompt_report_sections_filter
65
- self.pad_token_id = pad_token_id
66
-
67
- self.hidden_size = self.text_config.hidden_size if self.text_config is not None else None
68
-
69
 
70
  # self.ignore_index = ignore_index
71
  # self.image_token_index = image_token_index
 
62
  self.history = history
63
  self.tables_filter = tables_filter
64
  self.prompt_report_sections_filter = prompt_report_sections_filter
65
+ self.pad_token_id = pad_token_id
 
 
 
66
 
67
  # self.ignore_index = ignore_index
68
  # self.image_token_index = image_token_index
modelling_cxrmate_ed.py CHANGED
@@ -162,7 +162,7 @@ class CXRMateEDModel(transformers.LlavaForConditionalGeneration):
162
  FNNEncoder(
163
  num_features=self.luts[k]['total'],
164
  intermediate_size=self.config.index_value_encoder_intermediate_size,
165
- decoder_hidden_size=self.config.hidden_size,
166
  ),
167
  )
168
 
@@ -170,10 +170,10 @@ class CXRMateEDModel(transformers.LlavaForConditionalGeneration):
170
  self.time_delta_encoder = FNNEncoder(
171
  num_features=1,
172
  intermediate_size=self.config.index_value_encoder_intermediate_size,
173
- decoder_hidden_size=self.config.hidden_size,
174
  )
175
 
176
- self.token_type_embeddings = torch.nn.Embedding(max(self.token_type_to_token_type_id.values()) + 1, self.config.hidden_size)
177
 
178
  self.time_delta_map = lambda x: 1 / math.sqrt(x + 1)
179
  self.zero_time_delta_value = self.time_delta_map(0)
 
162
  FNNEncoder(
163
  num_features=self.luts[k]['total'],
164
  intermediate_size=self.config.index_value_encoder_intermediate_size,
165
+ decoder_hidden_size=self.config.text_config.hidden_size,
166
  ),
167
  )
168
 
 
170
  self.time_delta_encoder = FNNEncoder(
171
  num_features=1,
172
  intermediate_size=self.config.index_value_encoder_intermediate_size,
173
+ decoder_hidden_size=self.config.text_config.hidden_size,
174
  )
175
 
176
+ self.token_type_embeddings = torch.nn.Embedding(max(self.token_type_to_token_type_id.values()) + 1, self.config.text_config.hidden_size)
177
 
178
  self.time_delta_map = lambda x: 1 / math.sqrt(x + 1)
179
  self.zero_time_delta_value = self.time_delta_map(0)