suayptalha
commited on
Update modeling_minGRULM.py
Browse files- modeling_minGRULM.py +4 -5
modeling_minGRULM.py
CHANGED
@@ -127,19 +127,18 @@ class MinGRULMForCausalLM(PreTrainedModel):
|
|
127 |
This includes the wrapped model and any extra components like the language model head.
|
128 |
"""
|
129 |
state_dict = {}
|
130 |
-
|
131 |
# Add min_gru_model's state_dict
|
132 |
state_dict['model'] = self.model.min_gru_model.state_dict()
|
133 |
|
134 |
# Add lm_head's state_dict
|
135 |
state_dict['lm_head'] = self.lm_head.state_dict()
|
136 |
-
|
137 |
-
# Optionally, add config if needed
|
138 |
-
state_dict['config'] = self.config.state_dict()
|
139 |
|
|
|
|
|
|
|
140 |
return state_dict
|
141 |
|
142 |
-
|
143 |
@classmethod
|
144 |
def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):
|
145 |
"""
|
|
|
127 |
This includes the wrapped model and any extra components like the language model head.
|
128 |
"""
|
129 |
state_dict = {}
|
130 |
+
|
131 |
# Add min_gru_model's state_dict
|
132 |
state_dict['model'] = self.model.min_gru_model.state_dict()
|
133 |
|
134 |
# Add lm_head's state_dict
|
135 |
state_dict['lm_head'] = self.lm_head.state_dict()
|
|
|
|
|
|
|
136 |
|
137 |
+
# Add config as a dictionary (not state_dict, since it is not available)
|
138 |
+
state_dict['config'] = self.config.__dict__
|
139 |
+
|
140 |
return state_dict
|
141 |
|
|
|
142 |
@classmethod
|
143 |
def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):
|
144 |
"""
|