mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-06-09 07:07:16 -04:00
Fix missing initial space for LlamaTokenizer
This commit is contained in:
parent
92cdb4f22b
commit
15940e762e
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue