Skip to content

Commit

Permalink
remove resize token embeddings code
Browse files Browse the repository at this point in the history
  • Loading branch information
djliden committed Mar 8, 2024
1 parent b0ff299 commit 42d53d2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,11 @@
"special_tokens = [\"<|im_start|>\", \"<|im_end|>\"]\n",
"# Adding special tokens to the tokenizer\n",
"tokenizer.add_special_tokens({\"additional_special_tokens\": special_tokens})\n",
"# Resize the model's input token embeddings matrix\n",
"model.resize_token_embeddings(len(tokenizer))\n",
"\n",
"# Do not need to resize the model's input token embeddings matrix\n",
"# it is already larger than the vocabulary/large enough to accommodate\n",
"# the added tokens\n",
"# model.resize_token_embeddings(len(tokenizer))\n",
"\n",
"def format_slimorca(ex):\n",
" role_mapping = {\"gpt\": \"assistant\", \"system\": \"system\", \"human\": \"user\"}\n",
Expand Down

0 comments on commit 42d53d2

Please sign in to comment.