unslothai / unsloth

Finetune Llama 3.2, Mistral, Phi & Gemma LLMs 2-5x faster with 80% less memory
https://unsloth.ai
Apache License 2.0
16.43k stars 1.14k forks source link

Finetuning on Llama 3.1 instruct version throws Untrained tokens found error #1056

Open paraschopra opened 1 week ago

paraschopra commented 1 week ago

Replicating my issue from Discord here.

I'm following the provided notebook on my dataset, but it keeps throwing the following error:

Unsloth: Untrained tokens of [[128042, 128036]] found, but embed_tokens & lm_head not trainable, causing NaNs. Restart then add embed_tokens & lm_head to FastLanguageModel.get_peft_model(target_modules = [..., "embed_tokens", "lm_head",]). Are you using the base model? Instead, use the instruct version to silence this warning.

I generated data via llama only (so not sure why it is happening!)

See my notebook:

https://colab.research.google.com/drive/1YhKQk4lAhlO0rGwjlQQ6fiv680nimXXE?usp=sharing

Thanks for help!

danielhanchen commented 3 days ago

@paraschopra Sorry on the delay - the issue is weirdly your dataset is using <|reserved_special_token_28|> and <|reserved_special_token_34|>?