Lingua

TiktokenTokenizer.CreateAsync Metodo

Definizione

Overload

Nome Descrizione
CreateAsync(Stream, PreTokenizer, Normalizer, IReadOnlyDictionary<String,Int32>, Int32, CancellationToken)

Creare un nuovo oggetto tokenizer Tiktoken in modo asincrono.

CreateAsync(String, PreTokenizer, Normalizer, IReadOnlyDictionary<String,Int32>, Int32, CancellationToken)

Creare un nuovo oggetto tokenizer Tiktoken in modo asincrono.

CreateAsync(Stream, PreTokenizer, Normalizer, IReadOnlyDictionary<String,Int32>, Int32, CancellationToken)

Origine:
TiktokenTokenizer.cs
Origine:
TiktokenTokenizer.cs
Origine:
TiktokenTokenizer.cs

Creare un nuovo oggetto tokenizer Tiktoken in modo asincrono.

public static System.Threading.Tasks.Task<Microsoft.ML.Tokenizers.TiktokenTokenizer> CreateAsync(System.IO.Stream vocabStream, Microsoft.ML.Tokenizers.PreTokenizer? preTokenizer, Microsoft.ML.Tokenizers.Normalizer? normalizer, System.Collections.Generic.IReadOnlyDictionary<string,int>? specialTokens = default, int cacheSize = 8192, System.Threading.CancellationToken cancellationToken = default);
static member CreateAsync : System.IO.Stream * Microsoft.ML.Tokenizers.PreTokenizer * Microsoft.ML.Tokenizers.Normalizer * System.Collections.Generic.IReadOnlyDictionary<string, int> * int * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ML.Tokenizers.TiktokenTokenizer>
Public Shared Function CreateAsync (vocabStream As Stream, preTokenizer As PreTokenizer, normalizer As Normalizer, Optional specialTokens As IReadOnlyDictionary(Of String, Integer) = Nothing, Optional cacheSize As Integer = 8192, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TiktokenTokenizer)

Parametri

vocabStream
Stream

Flusso al file vocab BPE.

preTokenizer
PreTokenizer

Pre-tokenizer da usare.

normalizer
Normalizer

Normalizzatore da usare.

specialTokens
IReadOnlyDictionary<String,Int32>

Il dizionario esegue il mapping di token speciali agli ID.

cacheSize
Int32

Dimensioni della cache da usare.

cancellationToken
CancellationToken

CancellationToken utilizzato per richiedere l'annullamento dell'operazione.

Valori restituiti

Oggetto del tokenizer.

Commenti

Quando si crea il tokenizer, assicurarsi che il flusso del vocabolario venga originato da un provider attendibile.

Si applica a

CreateAsync(String, PreTokenizer, Normalizer, IReadOnlyDictionary<String,Int32>, Int32, CancellationToken)

Origine:
TiktokenTokenizer.cs
Origine:
TiktokenTokenizer.cs
Origine:
TiktokenTokenizer.cs

Creare un nuovo oggetto tokenizer Tiktoken in modo asincrono.

public static System.Threading.Tasks.Task<Microsoft.ML.Tokenizers.TiktokenTokenizer> CreateAsync(string vocabFilePath, Microsoft.ML.Tokenizers.PreTokenizer? preTokenizer, Microsoft.ML.Tokenizers.Normalizer? normalizer, System.Collections.Generic.IReadOnlyDictionary<string,int>? specialTokens = default, int cacheSize = 8192, System.Threading.CancellationToken cancellationToken = default);
static member CreateAsync : string * Microsoft.ML.Tokenizers.PreTokenizer * Microsoft.ML.Tokenizers.Normalizer * System.Collections.Generic.IReadOnlyDictionary<string, int> * int * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ML.Tokenizers.TiktokenTokenizer>
Public Shared Function CreateAsync (vocabFilePath As String, preTokenizer As PreTokenizer, normalizer As Normalizer, Optional specialTokens As IReadOnlyDictionary(Of String, Integer) = Nothing, Optional cacheSize As Integer = 8192, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TiktokenTokenizer)

Parametri

vocabFilePath
String

File vocab BPE.

preTokenizer
PreTokenizer

Pre-tokenizer da usare.

normalizer
Normalizer

Normalizzatore da usare.

specialTokens
IReadOnlyDictionary<String,Int32>

Il dizionario esegue il mapping di token speciali agli ID.

cacheSize
Int32

Dimensioni della cache da usare.

cancellationToken
CancellationToken

CancellationToken utilizzato per richiedere l'annullamento dell'operazione.

Valori restituiti

Oggetto del tokenizer.

Commenti

Quando si crea il tokenizer, assicurarsi che il file del vocabolario venga originato da un provider attendibile.

Si applica a