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

Method TokenToId

data_utils/tokenization.py:767–769  ·  view source on GitHub ↗

convert sentencpiece token to Id

(self, token)

Source from the content-addressed store, hash-verified

765 return self.sp.IdToPiece(Id)
766
767 def TokenToId(self, token):
768 """convert sentencpiece token to Id"""
769 return self.sp.PieceToId(token)
770
771 def DecodeIds(self, Ids):
772 """converts ids to a text string"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected