Skip to content

Commit

Permalink
use dict.update
Browse files Browse the repository at this point in the history
  • Loading branch information
tosemml committed Aug 31, 2023
1 parent 399bcb0 commit ffb04f1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions text2text/pytorch_pretrained_bert/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ def __init__(self,
if isinstance(vocab_size_or_config_json_file, str):
with open(vocab_size_or_config_json_file, "r", encoding='utf-8') as reader:
json_config = json.loads(reader.read())
for key, value in json_config.items():
self.__dict__[key] = value
self.__dict__.update(json_config)
elif isinstance(vocab_size_or_config_json_file, int):
self.vocab_size = vocab_size_or_config_json_file
self.hidden_size = hidden_size
Expand Down

0 comments on commit ffb04f1

Please sign in to comment.