Updated Home (markdown)
parent
fff5597002
commit
239e811bc7
1 changed files with 10 additions and 0 deletions
10
Home.md
10
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 `<CHARACTER_1>`, `<THINKING>` and `<SCRATCH_PAD>` we can do the following:
|
||||
```python
|
||||
model, tokenizer = FastLanguageModel.from_pretrained(...)
|
||||
from unsloth import add_new_tokens
|
||||
add_new_tokens(model, tokenizer, new_tokens = ["<CHARACTER_1>", "<THINKING>", "<SCRATCH_PAD>"])
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue