Skip to content
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

[fix] Fix loading pre-exported OV/ONNX model if export=False #3036

Merged

Conversation

tomaarsen
Copy link
Collaborator

Hello!

Pull Request overview

  • Fix loading pre-exported OV/ONNX model if export=False

Details

If export=False, then the subfolder and file_name are not set based on the current situation. This results in the model not being found. For example:

from sentence_transformers import SentenceTransformer

# Works!
model = SentenceTransformer("all-MiniLM-L6-v2", backend="onnx")
# Failed!
model = SentenceTransformer("all-MiniLM-L6-v2", backend="onnx", model_kwargs={"export": False})

After this PR, both work as expected.

  • Tom Aarsen

@tomaarsen tomaarsen merged commit cb81136 into UKPLab:master Nov 6, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant