mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2025-09-09 13:55:27 +00:00
⚡ support force thinking
This commit is contained in:
parent
6f3a39be08
commit
4385e85096
3 changed files with 7 additions and 5 deletions
|
@ -160,7 +160,7 @@ def local_chat(
|
|||
messages, add_generation_prompt=True, return_tensors="pt"
|
||||
)
|
||||
if force_think:
|
||||
token_thinks = torch.tensor([tokenizer.encode("<think>\\n",add_special_tokens=False)])
|
||||
token_thinks = torch.tensor([tokenizer.encode("<think>\\n",add_special_tokens=False)],device=input_tensor.device)
|
||||
input_tensor = torch.cat(
|
||||
[input_tensor, token_thinks], dim=1
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue