Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -149,7 +149,7 @@ def generate(
|
|
149 |
) -> Iterator[str]:
|
150 |
conversation = [*chat_history, {"role": "user", "content": message}]
|
151 |
|
152 |
-
input_ids = tokenizer.apply_chat_template(conversation, chat_template=chat_template, return_tensors="pt")
|
153 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|
154 |
input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
|
155 |
gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
|
|
|
149 |
) -> Iterator[str]:
|
150 |
conversation = [*chat_history, {"role": "user", "content": message}]
|
151 |
|
152 |
+
input_ids = tokenizer.apply_chat_template(conversation, chat_template=chat_template, enable_thinking=False, return_tensors="pt")
|
153 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|
154 |
input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
|
155 |
gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
|