Class QwenTokenizer
java.lang.Object
com.alibaba.dashscope.legacy_2x.tokenizers.QwenTokenizer
- All Implemented Interfaces:
Tokenizer
Deprecated.
BPE encode and decode, implementation reference https://github.com/openai/tiktoken and
https://github.com/karpathy/minbpe
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Decode token ids to StringDeprecated.Encode the input text, handles special tokens.encodeOrdinary(String text) Deprecated.Encoding that ignores any special tokens.
-
Constructor Details
-
QwenTokenizer
public QwenTokenizer()Deprecated.
-
-
Method Details
-
encodeOrdinary
Deprecated.Encoding that ignores any special tokens.- Specified by:
encodeOrdinaryin interfaceTokenizer- Parameters:
text- The input.- Returns:
- The list of token ids.
-
encode
public List<Integer> encode(String text, String allowedSpecial) throws NoSpecialTokenExists, UnSupportedSpecialTokenMode Deprecated.Encode the input text, handles special tokens.- Specified by:
encodein interfaceTokenizer- Parameters:
text- The input to be encode.allowedSpecial- The special token options can be "all"|"none"|"none_raise", if none_raise, then an error is raised if any special token is encountered in text, if null, use "all"- Returns:
- The list of token encode.
- Throws:
NoSpecialTokenExists- No special token in the input.UnSupportedSpecialTokenMode- the allowedSpecial is not["all"|"none"|"none_raise"]
-
decode
Deprecated.Description copied from interface:TokenizerDecode token ids to String
-