-
Notifications
You must be signed in to change notification settings - Fork 679
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
Not able to initialize HuggingFaceTokenizer in Vespa environment #2224
Comments
@dnmca We expect there is |
I am packaging the application as a JAR file. |
What os are you running on? Is that a x86_64 or aarch64? The exception thrown here: https://github.com/deepjavalibrary/djl/blob/master/api/src/main/java/ai/djl/util/Platform.java#L85 If you have a Can you copy the Platform code and add few more print out and see why it fall through to the exception line? |
I've printed out the value of variables
initialization fails because the following condition is satisfied:
It looks like the following resource is not being found:
And hence, |
@dnmca The problem is You might need to set a proper context class loader if your are use customized ClassLoader in your application. |
Hello @frankfliu and sorry for late reply. I've investigated a bit further, and it turns out that Vespa application is built as OSGi bundle and
Do you think that resetting context class loader would fix this? |
Thank you for the hint!
|
You are facing a common plugin issue. It looks like your plugin class loader is different from execution class loader (ContextClassLoader), which assume all the resources are loaded at plugin initialization time. You can either move HuggingFaceTokenizer to plugin initialization or use correct ContextClassLoader as your code. |
Hi @dnmca Thank you for posting a solution to your problem. I ran into the same issue and your solution worked for me as well. I think we are doing the exact same thing.
I'm curious to know if you ran into it as well and if you solved it. Else, I'll take a look and post here whatever solution I find. Thanks! |
You run into the same issue as: #179. Currently this only work for PyTorch native library. I can make it available for Huggingface as well |
@frankfliu I am trying to get the native helper working for huggingface as well. I'm finding that the helper works but then an error still gets thrown in at this line: 9106f95#diff-83b8cdd89c2c087ef69b441f0f73b423e93601cca9d8feed7bb711064c239951R306 Just looking at the code, it seems like this line defeats the purpose of the native helper. |
Description
I'm trying to test Vespa application with custom Embedder that uses DJL's HuggingFaceTokenizer under the hood.
It is initialized internally in a straightforward manner:
Local testing of this code was successful, but when this code is being run inside Vespa docker image, I'm getting the following error:
LibUtils is trying to load tokenizers library from CLASSPATH, but it seems that it's missing.
Before running my application in Docker image, I'm building maven project that contains the following dependency:
As far as I see from
build.gradle
oftokenizers
package, it relies on some external library files.Do I understand correctly that these libraries are not part of the following dependency and should be installed manually?
If that's not the case, what I'm doing wrong while applying
tokenizers
package for my use-case?Expected Behavior
I expect HuggingFaceTokenizer to initialize without errors.
Error Message
Please look in the first section.
How to Reproduce?
Unfortunately, I could not share code base.
Steps to reproduce
What have you tried to solve it?
Environment Info
The text was updated successfully, but these errors were encountered: