mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Keep GALACTICA special tokens (#300)
This commit is contained in:
parent
25a00eaf98
commit
a577fb1077
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user