-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I use SentencepieceTokenizer in C#? #468
Comments
Yes, the Nuget package could be found here: https://www.nuget.org/packages/Microsoft.ML.OnnxRuntime.Extensions/0.8.0 |
I only saw the C# demo code for registering the extension. For example: I defined it like this in python: |
@sayanshaw24 , can you add SPM tokenizer into our C# example? |
Perhaps this issue can be closed? I was looking for something similar on the decoder end and was able to develop what I think @tylike wanted. I should note beforehand that this was done using v0.8.0; the function Here's a working solution I came up with:
While this isn't C#, hopefully it illustrates how to perform inference using the ONNX tokenizer; it should be relatively straightforward to implement from the python code. Just make sure to load the extensions library when performing inference in C#:
This test helped me quite a bit:
|
Where are the folder for c# Examples? I see Java folder under the root but no trace of CSharp folder? |
hi!
I have an LLM in Onnx format and a sentencepiece.model, and I used HuggingFace and SententPiece together in Python. Now I plan to do inference in C# + OnnxRuntime, but I haven't found a suitable version of the SententPiece library in C#. I saw that there is a SentencepieceTokenizer here. Can I use SentencepieceTokenizer in C#?
My files were downloaded from here: https://huggingface.co/K024/ChatGLM-6b-onnx-u8s8/tree/main/chatglm-6b-int8-onnx-merged. Thank you."
The text was updated successfully, but these errors were encountered: