unsloth icon indicating copy to clipboard operation
unsloth copied to clipboard

Resize embeddings, tokenizers - adding new tokens don't work

Open danielhanchen opened this issue 1 year ago • 0 comments

From Twitter - adding new tokens to Qwen don't work?

# Add special tokens to the tokenizer
num_added_tokens = tokenizer.add_special_tokens({"additional_special_tokens": special_tokens})

# Resize token embeddings of the model
model.resize_token_embeddings(len(tokenizer))

danielhanchen avatar Oct 06 '24 00:10 danielhanchen