Skip to content

Commit d8a7dd8

Browse files
committed
fixes #3623: save PEFT config to transformer embeddings and export as param so that it loads correctly.
1 parent c6b053d commit d8a7dd8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

flair/embeddings/transformer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,7 @@ def is_supported_t5_model(config: PretrainedConfig) -> bool:
11281128
if "Please use the model as it is" not in str(e):
11291129
raise e
11301130

1131+
self.peft_config = peft_config
11311132
if peft_config is not None:
11321133
# add adapters for finetuning
11331134
try:
@@ -1376,6 +1377,7 @@ def to_params(self):
13761377
"subtoken_pooling": self.subtoken_pooling,
13771378
"cls_pooling": self.cls_pooling,
13781379
"config_state_dict": config_dict,
1380+
"peft_config": self.peft_config,
13791381
}
13801382

13811383
return model_state

0 commit comments

Comments
 (0)