Skip to content

Commit

Permalink
Keep GALACTICA special tokens (oobabooga#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
oobabooga committed Mar 16, 2023
1 parent 25a00ea commit a577fb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/text_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def encode(prompt, tokens_to_generate=0, add_special_tokens=True):

def decode(output_ids):
# Open Assistant relies on special tokens like <|endoftext|>
if re.match('oasst-*', shared.model_name.lower()):
if re.match('(oasst|galactica)-*', shared.model_name.lower()):
return shared.tokenizer.decode(output_ids, skip_special_tokens=False)
else:
reply = shared.tokenizer.decode(output_ids, skip_special_tokens=True)
Expand Down

0 comments on commit a577fb1

Please sign in to comment.