Deal with nested configs better in base class (#25237)
* Deal better with nested configs * Fixes * More fixes * Fix last test * Clean up existing configs * Remove hack in MPT Config * Update src/transformers/configuration_utils.py Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com> * Fix setting a nested config via dict in the kwargs * Adapt common test * Add test for nested config load with dict --------- Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
This commit is contained in:
@@ -118,9 +118,11 @@ class ConfigTester(object):
|
||||
|
||||
def check_config_can_be_init_without_params(self):
|
||||
if self.config_class.is_composition:
|
||||
return
|
||||
config = self.config_class()
|
||||
self.parent.assertIsNotNone(config)
|
||||
with self.parent.assertRaises(ValueError):
|
||||
config = self.config_class()
|
||||
else:
|
||||
config = self.config_class()
|
||||
self.parent.assertIsNotNone(config)
|
||||
|
||||
def check_config_arguments_init(self):
|
||||
kwargs = copy.deepcopy(config_common_kwargs)
|
||||
|
||||
Reference in New Issue
Block a user