Add support for BPE tokenization.

This commit is contained in:
alex committed 2023-04-23 18:49:52 -07:00
1 parent 0fe35cd976
commit f61fe6a18f
9 files changed
+562 -17

No files matched your search

+40
View File
@@ -350,3 +350,43 @@ service ImageGenerationService {
*/
rpc GenerateImagesStreaming(GenerateImagesRequest) returns (stream GenerateImagesStreamUpdate);
}
/**
* Represents a request to tokenize an input.
*/
message TokenizeRequest {
/**
* The name of a loaded model to use for tokenization.
*/
string model_name = 1;
/**
* The input string to tokenize.
*/
string input = 2;
}
/**
* Represents a response to tokenization.
*/
message TokenizeResponse {
/**
* The tokens inside the input string.
*/
repeated string tokens = 1;
/**
* The token IDs inside the input string.
*/
repeated uint64 token_ids = 2;
}
/**
* The tokenizer service, for analyzing tokens for a loaded model.
*/
service TokenizerService {
/**
* Analyze the input using a loaded model and return the results.
*/
rpc Tokenize(TokenizeRequest) returns (TokenizeResponse);
}