Skip to content

Commit

Permalink
generated_ids开头加上了bos_token,需要将inpu的内容截断,只输出Assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
bestpredicts committed Apr 9, 2023
1 parent 7b2b0b9 commit 7507174
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gptq/llama_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def noop(*args, **kwargs):
temperature=args.temperature,
)
print("Assistant:\n")
print(tokenizer.decode([el.item() for el in generated_ids[0]])[len(inputs):])
print(tokenizer.decode([el.item() for el in generated_ids[0]])[len(inputs)+4:]) # generated_ids开头加上了bos_token,需要将inpu的内容截断,只输出Assistant
print("\n-------------------------------\n")
print("Human:") #每次终端用户输入前,加上Human提示。
line = input()

0 comments on commit 7507174

Please sign in to comment.