Skip to content

Commit a5211fc

Browse files
Rocketknight1LysandreJik
authored andcommitted
Revert "Experimenting with adding proper get_config() and from_config() methods (huggingface#14361)"
This reverts commit e99a231.
1 parent 527c763 commit a5211fc

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

src/transformers/modeling_tf_utils.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -692,13 +692,6 @@ def __init__(self, config, *inputs, **kwargs):
692692
self.config = config
693693
self.name_or_path = config.name_or_path
694694

695-
def get_config(self):
696-
return self.config
697-
698-
@classmethod
699-
def from_config(cls, config, **kwargs):
700-
return cls._from_config(config, **kwargs)
701-
702695
@classmethod
703696
def _from_config(cls, config, **kwargs):
704697
"""

tests/test_modeling_tf_common.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,6 @@ def test_save_load(self):
160160

161161
self.assert_outputs_same(after_outputs, outputs)
162162

163-
def test_save_load_config(self):
164-
config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
165-
166-
for model_class in self.all_model_classes:
167-
model = model_class(config)
168-
outputs = model(self._prepare_for_class(inputs_dict, model_class))
169-
170-
new_model = model_class.from_config(model.get_config())
171-
_ = new_model(self._prepare_for_class(inputs_dict, model_class)) # Build model
172-
new_model.set_weights(model.get_weights())
173-
after_outputs = new_model(self._prepare_for_class(inputs_dict, model_class))
174-
175-
self.assert_outputs_same(after_outputs, outputs)
176-
177163
@tooslow
178164
def test_graph_mode(self):
179165
config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()

0 commit comments

Comments
 (0)