Custom config error when model.save_pretrained
I created a model with a custom head. To save the model I created a custom config. But I get the following error:__init__() missing 2 required positional arguments: 'model_type' and 'hidden_size'when I save the model withmodel.save_pretrained(path)That’s my config class:class ReaderConfig(PretrainedConfig):
    
    def __init__(self,model_type:str,hidden_size:int,**kwargs,):

        self.model_type = model_type
        self.hidden_size = hidden_size
        super().__init__(**kwargs)That’s the error message:--> 756 class_config_dict = self.__class__().to_dict() if not self.is_composition else {}
    758 serializable_config_dict = {}
    760 # only serialize values that differ from the default config

TypeError: __init__() missing 2 required positional arguments: 'model_type' and 'hidden_size'Does any one know what could be wrong?
2022-11-21T19:04:29Z
I found out what was wrong.Theinitfunction in the config class needs to provide default values.class ReaderConfig(PretrainedConfig):
    
    def __init__(self,model_type:str='bert-base-uncased',hidden_size:int=1024,**kwargs,):

        self.model_type = model_type
        self.hidden_size = hidden_size
        super().__init__(**kwargs)
2023-09-08T15:52:27Z
thanks you very helpful
2024-04-15T18:04:27Z
Thank you this fix with providing default values unblocked me