We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e348ac8 commit 1471702Copy full SHA for 1471702
1 file changed
demo/app.py
@@ -48,7 +48,7 @@ def generate(
48
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
49
conversation.append({"role": "user", "content": message})
50
51
- input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
+ input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt", add_generation_prompt=True)
52
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
53
input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
54
gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
0 commit comments