MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / encode_segment

Method encode_segment

accessory/model/tokenizer.py:64–69  ·  view source on GitHub ↗
(self, s:str)

Source from the content-addressed store, hash-verified

62 return t
63
64 def encode_segment(self, s:str):
65 s = s.lstrip(' ')
66 if self.need_space_before_segment:
67 return self.encode(" " + s, bos=False, eos=False)
68 else:
69 return self.encode(s, bos=False, eos=False)
70
71 def encode_wo_prefix_space(self, s:str):
72 if self.need_space_before_segment:

Callers 2

generateMethod · 0.80
get_item_funcMethod · 0.80

Calls 1

encodeMethod · 0.95

Tested by

no test coverage detected