Skip to content

Commit

Permalink
Keep the new hyperparameters when fine-tuning a model, fix: #1942
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Jan 14, 2025
1 parent a639dbc commit 80506cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hanlp/common/torch_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ def fit(self,
_dummy_placeholder = self._create_dummy_placeholder_on(first_device)
if finetune:
if isinstance(finetune, str):
self.load(finetune, devices=devices)
self.load(finetune, devices=devices, **self.config)
else:
self.load(save_dir, devices=devices)
self.load(save_dir, devices=devices, **self.config)
self.config.finetune = finetune
self.vocabs.unlock() # For extending vocabs
logger.info(
Expand Down

0 comments on commit 80506cf

Please sign in to comment.