logo
Browse Source

change train self.model to self._model

main
ChengZi 2 years ago
parent
commit
d2fb633df2
  1. 4
      auto_transformers.py

4
auto_transformers.py

@ -404,7 +404,7 @@ class AutoTransformers(NNOperator):
if task == 'mlm' or task is None: if task == 'mlm' or task is None:
model_with_head = AutoModelForMaskedLM.from_pretrained(self.model_name) model_with_head = AutoModelForMaskedLM.from_pretrained(self.model_name)
if prepare_model_weights_f is not None: if prepare_model_weights_f is not None:
model_with_head = prepare_model_weights_f(self.model, model_with_head, **kwargs)
model_with_head = prepare_model_weights_f(self._model, model_with_head, **kwargs)
train_mlm_with_hf_trainer( train_mlm_with_hf_trainer(
model_with_head, model_with_head,
@ -416,7 +416,7 @@ class AutoTransformers(NNOperator):
elif task == 'clm': elif task == 'clm':
model_with_head = AutoModelForCausalLM.from_pretrained(self.model_name) model_with_head = AutoModelForCausalLM.from_pretrained(self.model_name)
if prepare_model_weights_f is not None: if prepare_model_weights_f is not None:
model_with_head = prepare_model_weights_f(self.model, model_with_head, **kwargs)
model_with_head = prepare_model_weights_f(self._model, model_with_head, **kwargs)
train_clm_with_hf_trainer( train_clm_with_hf_trainer(
model_with_head, model_with_head,

Loading…
Cancel
Save