Content-Length: 275264 | pFad | http://github.com/postgresml/postgresml/commit/da509e28602bc4abaec74205578ba97dc54d9608

B7 Skip decoding special tokens (#1244) · postgresml/postgresml@da509e2 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgresml/postgresml/commit/da509e28602bc4abaec74205578ba97dc54d9608

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy