MCPcopy Create free account
hub / github.com/THUDM/GLM / TokenToId

Method TokenToId

data_utils/tokenization.py:597–599  ·  view source on GitHub ↗

ascii character to index

(self, token)

Source from the content-addressed store, hash-verified

595 return chr(Id)
596
597 def TokenToId(self, token):
598 """ascii character to index"""
599 return ord(token)
600
601 def DecodeIds(self, Ids):
602 """converts ascii ids to tokens before joining them into text"""

Callers 1

EncodeAsIdsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected