mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 17:29:22 +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):
|
def decode(output_ids):
|
||||||
# Open Assistant relies on special tokens like <|endoftext|>
|
# 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)
|
return shared.tokenizer.decode(output_ids, skip_special_tokens=False)
|
||||||
else:
|
else:
|
||||||
reply = shared.tokenizer.decode(output_ids, skip_special_tokens=True)
|
reply = shared.tokenizer.decode(output_ids, skip_special_tokens=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user