Skip to content

Commit

Permalink
lora : warn user if new token is added in the adapter (#9948)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxson authored Oct 22, 2024
1 parent 4ff7fe1 commit c421ac0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions convert_lora_to_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ def get_tensors(self) -> Iterator[tuple[str, Tensor]]:
if ".base_layer.weight" in name:
continue
logger.error(f"Unexpected name '{name}': Not a lora_A or lora_B tensor")
if ".embed_tokens.weight" in name or ".lm_head.weight" in name:
logger.error("Embeddings is present in the adapter. This can be due to new tokens added during fine tuning")
logger.error("Hint: if you are using TRL, make sure not to call setup_chat_format()")
sys.exit(1)

if base_name in tensor_map:
Expand Down

0 comments on commit c421ac0

Please sign in to comment.