Skip to content

Commit da509e2

Browse files
authored
Skip decoding special tokens (#1244)
1 parent a64be9b commit da509e2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pgml-extension/src/bindings/transformers/transformers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ def stream(self, input, timeout=None, **kwargs):
314314
self.tokenizer,
315315
timeout=timeout,
316316
skip_prompt=True,
317+
skip_special_tokens=True
317318
)
318319
if "chat_template" in kwargs:
319320
input = self.tokenizer.apply_chat_template(
@@ -338,6 +339,7 @@ def stream(self, input, timeout=None, **kwargs):
338339
streamer = TextIteratorStreamer(
339340
self.tokenizer,
340341
timeout=timeout,
342+
skip_special_tokens=True
341343
)
342344
input = self.tokenizer(input, return_tensors="pt", padding=True).to(
343345
self.model.device

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy