-
Notifications
You must be signed in to change notification settings - Fork 147
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
SentenceTransformer Unrecognized option: -c #520
Comments
This error indicates that the JVM was not even created but your comments indicate specific lines are the problem. I do not understand how those lines would execute if jvm creation failed. |
@bsteffensmeier that’s my confusion as well. The jvm starts and completes with the right output. The error is printed out but seems to be ignored. |
It looks like sentence transformer is using a multiprocessing mechanism which is trying to spawn new processes. I suspect it is trying to start python processes however since jep is a java process it may be spawning java processes instead which does not work. It looks like multiprocessing.set_executable() can be used to point to the correct python executable. I am not sure if torch mukltiprocessing is using multiprocessing internally but it is worth a try. |
@bsteffensmeier your explanation makes sense, thank you! Indeed, adding two lines after the initial imports fixes the issue:
|
Describe the bug
Getting this exception
When calling
mainJepInterpreter.eval("sentence_transformer = SentenceTransformer(\"sentence-transformers/gtr-t5-large\")");
The next statement is executing correctly:
mainJepInterpreter.eval("output = sentence_transformer.encode('test')[0]");
To Reproduce
Java Code:
Cannot reproduce from jep console:
Expected behavior
No exception thrown.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: