Skip to content

Commit 80506cf

Browse files
committed
Keep the new hyperparameters when fine-tuning a model, fix: #1942
1 parent a639dbc commit 80506cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hanlp/common/torch_component.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ def fit(self,
248248
_dummy_placeholder = self._create_dummy_placeholder_on(first_device)
249249
if finetune:
250250
if isinstance(finetune, str):
251-
self.load(finetune, devices=devices)
251+
self.load(finetune, devices=devices, **self.config)
252252
else:
253-
self.load(save_dir, devices=devices)
253+
self.load(save_dir, devices=devices, **self.config)
254254
self.config.finetune = finetune
255255
self.vocabs.unlock() # For extending vocabs
256256
logger.info(

0 commit comments

Comments
 (0)