-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fixed lazy-import bugs that occurred during refactoring. (#20)
Signed-off-by: wxywb <[email protected]>
- Loading branch information
Showing
9 changed files
with
50 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
__all__ = ["DefaultEmbeddingFunction", "dense", "sparse", "hybrid", "reranker", "utils"] | ||
|
||
from . import dense, hybrid, sparse, reranker, utils | ||
from .dense import OnnxEmebeddingFunction | ||
|
||
DefaultEmbeddingFunction = OnnxEmebeddingFunction | ||
DefaultEmbeddingFunction = dense.onnx.OnnxEmbeddingFunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
from .bm25 import BM25EmbeddingFunction | ||
from .splade import SpladeEmbeddingFunction | ||
|
||
__all__ = ["SpladeEmbeddingFunction", "BM25EmbeddingFunction"] | ||
|
||
|
||
from milvus_model.utils.lazy_import import LazyImport | ||
|
||
bm25 = LazyImport("bm25", globals(), "milvus_model.sparse.bm25") | ||
splade = LazyImport("openai", globals(), "milvus_model.sparse.splade") | ||
|
||
def BM25EmbeddingFunction(*args, **kwargs): | ||
return bm25.BM25EmbeddingFunction(*args, **kwargs) | ||
|
||
def SpladeEmbeddingFunction(*args, **kwargs): | ||
return splade.SpladeEmbeddingFunction(*args, **kwargs) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ def __getattr__(self, item): | |
|
||
def __dir__(self): | ||
module = self._load() | ||
return dir(module) | ||
return dir(module) |