omitakahiro commited on
Commit
a9ecf73
1 Parent(s): fdff80b

Update notebooks/LoRA.ipynb

Browse files
Files changed (1) hide show
  1. notebooks/LoRA.ipynb +2 -1
notebooks/LoRA.ipynb CHANGED
@@ -50,7 +50,8 @@
50
  "def encode(sample):\n",
51
  " prompt = prompt_template.format(instruction=sample[\"instruction\"], input=sample[\"input\"])\n",
52
  " target = sample[\"output\"]\n",
53
- " input_ids_prompt, input_ids_target = tokenizer([prompt, target]).input_ids\n",
 
54
  " input_ids_target = input_ids_target + [ tokenizer.eos_token_id ]\n",
55
  " input_ids = input_ids_prompt + input_ids_target\n",
56
  " labels = input_ids.copy()\n",
 
50
  "def encode(sample):\n",
51
  " prompt = prompt_template.format(instruction=sample[\"instruction\"], input=sample[\"input\"])\n",
52
  " target = sample[\"output\"]\n",
53
+ " input_ids_prompt, input_ids_target = tokenizer([prompt, target], add_special_tokens=False).input_ids\n",
54
+ " input_ids_prompt = [ tokenizer.bos_token_id ] + input_ids_prompt\n",
55
  " input_ids_target = input_ids_target + [ tokenizer.eos_token_id ]\n",
56
  " input_ids = input_ids_prompt + input_ids_target\n",
57
  " labels = input_ids.copy()\n",