]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
lora : warn user if new token is added in the adapter (#9948)
authorXuan Son Nguyen <redacted>
Tue, 22 Oct 2024 11:08:41 +0000 (13:08 +0200)
committerGitHub <redacted>
Tue, 22 Oct 2024 11:08:41 +0000 (13:08 +0200)
convert_lora_to_gguf.py

index 439a78de108cacb3c1b8d53052e721d8fef64d90..bc68f68afb7686c8053e93df39409220fbd4eb25 100755 (executable)
@@ -348,6 +348,9 @@ if __name__ == '__main__':
                         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: