Język

TiktokenTokenizer.CreateAsync Metoda

Definicja

Przeciążenia

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

Źródło:
TiktokenTokenizer.cs
Źródło:
TiktokenTokenizer.cs
Źródło:
TiktokenTokenizer.cs

Utwórz nowy obiekt tokenizatora Tiktoken asynchronicznie.

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)

Parametry

vocabStream
Stream

Strumień do pliku vocab BPE.

preTokenizer
PreTokenizer

Pre-tokenizer do użycia.

normalizer
Normalizer

Normalizator do użycia.

specialTokens
IReadOnlyDictionary<String,Int32>

Słownik mapuje specjalne tokeny na identyfikatory.

cacheSize
Int32

Rozmiar pamięci podręcznej do użycia.

cancellationToken
CancellationToken

CancellationToken służy do żądania anulowania operacji.

Zwraca

Obiekt tokenizatora.

Uwagi

Podczas tworzenia tokenizatora upewnij się, że strumień słownictwa jest pozyskiwany od zaufanego dostawcy.

Dotyczy

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

Źródło:
TiktokenTokenizer.cs
Źródło:
TiktokenTokenizer.cs
Źródło:
TiktokenTokenizer.cs

Utwórz nowy obiekt tokenizatora Tiktoken asynchronicznie.

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)

Parametry

vocabFilePath
String

Plik vocab BPE.

preTokenizer
PreTokenizer

Pre-tokenizer do użycia.

normalizer
Normalizer

Normalizator do użycia.

specialTokens
IReadOnlyDictionary<String,Int32>

Słownik mapuje specjalne tokeny na identyfikatory.

cacheSize
Int32

Rozmiar pamięci podręcznej do użycia.

cancellationToken
CancellationToken

CancellationToken służy do żądania anulowania operacji.

Zwraca

Obiekt tokenizatora.

Uwagi

Podczas tworzenia tokenizatora upewnij się, że plik słownictwa pochodzi od zaufanego dostawcy.

Dotyczy