mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Adds type checking to PreTrainedConfig. (#20926)
This commit is contained in:
parent
8637316e5e
commit
491a33d138
@ -732,7 +732,7 @@ class PretrainedConfig(PushToHubMixin):
|
||||
return json.loads(text)
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.__dict__ == other.__dict__
|
||||
return isinstance(other, PretrainedConfig) and (self.__dict__ == other.__dict__)
|
||||
|
||||
def __repr__(self):
|
||||
return f"{self.__class__.__name__} {self.to_json_string()}"
|
||||
|
Loading…
Reference in New Issue
Block a user