MCPcopy Create free account
hub / github.com/IBM/Project_CodeNet / decode

Function decode

model-experiments/masked-language-model/infer.py:70–71  ·  view source on GitHub ↗
(tokens)

Source from the content-addressed store, hash-verified

68
69# Opposite of encode: restores text string from token ids.
70def decode(tokens):
71 return " ".join([id2token[t] for t in tokens if t != 0])
72
73# Do predictions:
74def predict(text):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected