MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / encode_ids

Function encode_ids

examples/tensorflow/xlnet/convertInput.py:386–389  ·  view source on GitHub ↗
(sp_model, text, sample=False)

Source from the content-addressed store, hash-verified

384
385
386def encode_ids(sp_model, text, sample=False):
387 pieces = encode_pieces(sp_model, text, return_unicode=False, sample=sample)
388 ids = [sp_model.PieceToId(piece) for piece in pieces]
389 return ids
390
391
392# Convert functions

Callers 1

tokenize_fnFunction · 0.85

Calls 1

encode_piecesFunction · 0.85

Tested by

no test coverage detected