how to calculator model input/output tokens length with java #3142
Answered
by
frankfliu
gabohouhou
asked this question in
Q&A
-
with python,here is an example : input_text_list = ["who are you?","how old are you","color see see"] print('model_inputs: ', model_inputs) now i need a java sdk to implement calculator model_input tokens length. i learn djl tokenization, but i can not find how to load voc、tokenization.json from local disk。 |
Beta Was this translation helpful? Give feedback.
Answered by
frankfliu
May 3, 2024
Replies: 1 comment 1 reply
-
Here is example: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
gabohouhou
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is example:
https://github.com/deepjavalibrary/djl/blob/master/extensions/tokenizers/src/test/java/ai/djl/huggingface/tokenizers/HuggingFaceTokenizerTest.java#L114-L115