mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Fix missing initial space for LlamaTokenizer
This commit is contained in:
parent
92cdb4f22b
commit
15940e762e
@ -69,6 +69,11 @@ def get_reply_from_output_ids(output_ids, input_ids, original_question, state):
|
||||
else:
|
||||
new_tokens = len(output_ids) - len(input_ids[0])
|
||||
reply = decode(output_ids[-new_tokens:], state['skip_special_tokens'])
|
||||
|
||||
if type(shared.tokenizer) is transformers.LlamaTokenizer:
|
||||
if len(original_question) > 0 and original_question[-1] not in [' ', '\n']:
|
||||
reply = ' ' + reply
|
||||
|
||||
if not shared.is_chat():
|
||||
reply = original_question + apply_extensions('output', reply)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user