diff --git a/Home.md b/Home.md index 1a8801b..ef015c5 100644 --- a/Home.md +++ b/Home.md @@ -263,6 +263,16 @@ tokenizer = get_chat_template( ) ``` +### Adding new tokens +Unsloth has a function called `add_new_tokens` which allows you to add new tokens to your finetune. For example if you want to add ``, `` and `` we can do the following: +```python +model, tokenizer = FastLanguageModel.from_pretrained(...) +from unsloth import add_new_tokens +add_new_tokens(model, tokenizer, new_tokens = ["", "", ""]) +model = FastLanguageModel.get_peft_model(...) +``` +Note - you MUST always call `add_new_tokens` before `FastLanguageModel.get_peft_model`! + ### 2x Faster Inference Unsloth supports natively 2x faster inference. All QLoRA, LoRA and non LoRA inference paths are 2x faster. This requires no change of code or any new dependencies. ```python