AlexHung29629 commited on
Commit
0188efc
·
verified ·
1 Parent(s): a058d44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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.")