TiktokenTokenizer.CreateForModelAsync Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Créez un tokenizer Tiktoken basé sur le nom du modèle et le fichier vocab.
public static System.Threading.Tasks.Task<Microsoft.ML.Tokenizers.TiktokenTokenizer> CreateForModelAsync(string modelName, System.IO.Stream vocabStream, System.Collections.Generic.IReadOnlyDictionary<string,int>? extraSpecialTokens = default, int cacheSize = 8192, Microsoft.ML.Tokenizers.Normalizer? normalizer = default, System.Threading.CancellationToken cancellationToken = default);
static member CreateForModelAsync : string * System.IO.Stream * System.Collections.Generic.IReadOnlyDictionary<string, int> * int * Microsoft.ML.Tokenizers.Normalizer * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ML.Tokenizers.TiktokenTokenizer>
Public Shared Function CreateForModelAsync (modelName As String, vocabStream As Stream, Optional extraSpecialTokens As IReadOnlyDictionary(Of String, Integer) = Nothing, Optional cacheSize As Integer = 8192, Optional normalizer As Normalizer = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TiktokenTokenizer)
Paramètres
- modelName
- String
Nom du modèle
- vocabStream
- Stream
Flux vers le fichier vocaux BPE.
- extraSpecialTokens
- IReadOnlyDictionary<String,Int32>
Jetons spéciaux supplémentaires autres que les jetons intégrés pour le modèle
- cacheSize
- Int32
Taille du cache à utiliser.
- normalizer
- Normalizer
Pour normaliser le texte avant la tokenisation
- cancellationToken
- CancellationToken
CancellationToken utilisé pour demander l’annulation de l’opération.
Retours
Le tokenizer