MCPcopy Create free account
hub / github.com/OpenMOSS/MOSS / _convert_id_to_token

Method _convert_id_to_token

models/tokenization_moss.py:265–267  ·  view source on GitHub ↗

Converts an index (integer) in a token (str) using the vocab.

(self, index)

Source from the content-addressed store, hash-verified

263 return self.encoder.get(token, self.encoder.get(self.unk_token))
264
265 def _convert_id_to_token(self, index):
266 """Converts an index (integer) in a token (str) using the vocab."""
267 return self.decoder.get(index)
268
269 def convert_tokens_to_string(self, tokens):
270 """Converts a sequence of tokens (string) in a single string."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected