Skip to content

Commit c421ac0

Browse files
authored
lora : warn user if new token is added in the adapter (#9948)
1 parent 4ff7fe1 commit c421ac0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

convert_lora_to_gguf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ def get_tensors(self) -> Iterator[tuple[str, Tensor]]:
348348
if ".base_layer.weight" in name:
349349
continue
350350
logger.error(f"Unexpected name '{name}': Not a lora_A or lora_B tensor")
351+
if ".embed_tokens.weight" in name or ".lm_head.weight" in name:
352+
logger.error("Embeddings is present in the adapter. This can be due to new tokens added during fine tuning")
353+
logger.error("Hint: if you are using TRL, make sure not to call setup_chat_format()")
351354
sys.exit(1)
352355

353356
if base_name in tensor_map:

0 commit comments

Comments
 (0)