Skip to content

Commit

Permalink
bos, eos in generate.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tloen committed Mar 23, 2023
1 parent 1384a4d commit 8955a9c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
device_map={"": device},
)

# unwind broken decapoda-research config
model.config.pad_token_id = tokenizer.pad_token_id = 0 # unk
model.config.bos_token_id = 1
model.config.eos_token_id = 2


def generate_prompt(instruction, input=None):
if input:
Expand All @@ -80,6 +85,7 @@ def generate_prompt(instruction, input=None):
### Response:"""


if not LOAD_8BIT:
model.half() # seems to fix bugs for some users.

Expand Down

0 comments on commit 8955a9c

Please sign in to comment.