PadTokenId
: int
[Get] |
Signature
int PadTokenId |
Decode
(
tokenIds
)
|
Signature
string Decode(List< int > tokenIds) Parameters tokenIds: List< int >Returns string |
EncodeAsync
(
text
, ct
)
|
Asynchronously encodes text to token IDs on a background thread.
Use this to avoid blocking the main thread and prevent frame drops. May be slower overall, but maintains consistent frame rate.
Signature
async Task< List< int > > EncodeAsync(string text, CancellationToken ct=default) Parameters text: stringct: CancellationTokenReturns async Task< List< int > > |
Initialize
(
vocab
, merges
, config
)
|
Signature
void Initialize(TextAsset vocab, TextAsset merges, TextAsset config) Parameters vocab: TextAssetmerges: TextAssetconfig: TextAssetReturns void |