INNER CODE UNIT · Python
update_from_dict
shibing624/pytextclassifier · pytextclassifier/bert_classfication_utils.py:136
def update_from_dict(self, new_values):
if isinstance(new_values, dict):
for key, value in new_values.items():
setattr(self, key, value)
else:
raise (TypeError(f"{new_values} is not a Python dict."))
def get_args_for_saving(self):
args_for_saving = {
key: value
for key, value in asdict(self).items()
if key not in self.not_saved_args
}
if "settings" in args_for_saving["wandb_kwargs"]:
del args_for_saving["wandb_kwargs"]["settings"]
return args_for_saving
def save(self, output_dir):