Skip to content

MLRetrieval.load() Failure #114

Description

@abhishekreddyallu

MLRetrieval.load() ignores user supplied SentenceTransformer path

MLRetrieval.load(path=...) ignored the supplied path argument and passed self.path to SentenceTransformer instead.

Location:ontoaligner/aligner/retrieval/retrieval.py:268

Current code:

self.model = SentenceTransformer(self.path, device=self.kwargs["device"])

Since self.path is not assigned from the path argument, the model loader can receive an empty or stale path instead of the requested model.

SentenceTransformer received path: ''
SentenceTransformer received device: 'cpu'
AssertionError: BUG CONFIRMED: load(path='requested-model') ignored the path.

Fix

Use the supplied path argument directly like :

self.model = SentenceTransformer(path, device=self.kwargs["device"])

This matches the existing BiEncoderRetrieval.load() style:

self.model = SentenceTransformer(path, device=self.kwargs["device"], trust_remote_code=True)

After fix

PASS: MLRetrieval.load() forwarded the supplied path correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions