MCPcopy
hub / github.com/tinygrad/tinygrad / prefix

Method prefix

tinygrad/llm/cli.py:84–85  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

82 if self.preset == 'tekken': return self.encode("[/INST]")
83 return [self.eos_id]
84 def prefix(self) -> list[int]:
85 return ([] if self.bos_id is None else [self.bos_id]) + (self.encode("<sop>") if self.preset == 'glm4' else [])
86 def is_end(self, token_id:int) -> bool: return token_id in (self.eos_id, self.eot_id)
87
88models = {

Callers 2

do_POSTMethod · 0.80
mainFunction · 0.80

Calls 1

encodeMethod · 0.95

Tested by

no test coverage detected