Spaces:
Runtime error
Runtime error
Mikhil-jivus
commited on
Commit
•
3bab56d
1
Parent(s):
f345482
Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,7 @@ def generate(
|
|
61 |
)
|
62 |
conversation.append({"role": "user", "content": message})
|
63 |
|
64 |
-
input_ids = tokenizer.apply_chat_template(conversation, add_generation_prompt=True, return_tensors="pt")
|
65 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|
66 |
input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
|
67 |
gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
|
|
|
61 |
)
|
62 |
conversation.append({"role": "user", "content": message})
|
63 |
|
64 |
+
input_ids = tokenizer.apply_chat_template(conversation, add_generation_prompt=True,add_special_tokens = True, return_tensors="pt")
|
65 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|
66 |
input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
|
67 |
gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
|