Skip to content

Commit ae35a96

Browse files
authored
new: simplify imports (#171)
* new: simplify imports * refactoring: update import
1 parent 25671ec commit ae35a96

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FastEmbed is a lightweight, fast, Python library built for embedding generation. We [support popular text models](https://qdrant.github.io/fastembed/examples/Supported_Models/). Please [open a GitHub issue](https://github.com/qdrant/fastembed/issues/new) if you want us to add a new model.
44

5-
The default text embedding (`TextEmbedding`) model is Flag Embedding, the top model in the [MTEB](https://huggingface.co/spaces/mteb/leaderboard) leaderboard. It supports "query" and "passage" prefixes for the input text. Here is an example for [Retrieval Embedding Generation](https://qdrant.github.io/fastembed/examples/Retrieval_with_FastEmbed/) and how to use [FastEmbed with Qdrant](https://qdrant.github.io/fastembed/examples/Usage_With_Qdrant/).
5+
The default text embedding (`TextEmbedding`) model is Flag Embedding, presented in the [MTEB](https://huggingface.co/spaces/mteb/leaderboard) leaderboard. It supports "query" and "passage" prefixes for the input text. Here is an example for [Retrieval Embedding Generation](https://qdrant.github.io/fastembed/examples/Retrieval_with_FastEmbed/) and how to use [FastEmbed with Qdrant](https://qdrant.github.io/fastembed/examples/Usage_With_Qdrant/).
66

77
## 📈 Why FastEmbed?
88

@@ -23,7 +23,6 @@ pip install fastembed
2323
## 📖 Quickstart
2424

2525
```python
26-
import numpy as np
2726
from fastembed import TextEmbedding
2827
from typing import List
2928

fastembed/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import importlib.metadata
22

3-
from fastembed.text.text_embedding import TextEmbedding
3+
from fastembed.text import TextEmbedding
4+
from fastembed.sparse import SparseTextEmbedding, SparseEmbedding
45

56
__version__ = importlib.metadata.version("fastembed")
6-
__all__ = ["TextEmbedding"]
7+
__all__ = ["TextEmbedding", "SparseTextEmbedding", "SparseEmbedding"]

fastembed/embedding.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from loguru import logger
44

5-
from fastembed.text.text_embedding import TextEmbedding
5+
from fastembed import TextEmbedding
66

77
logger.warning(
88
"DefaultEmbedding, FlagEmbedding, JinaEmbedding are deprecated."

fastembed/sparse/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from fastembed.sparse.sparse_embedding_base import SparseEmbedding
2+
from fastembed.sparse.sparse_text_embedding import SparseTextEmbedding
3+
4+
__all__ = ["SparseEmbedding", "SparseTextEmbedding"]

fastembed/text/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from fastembed.text.text_embedding import TextEmbedding
2+
3+
__all__ = ["TextEmbedding"]

0 commit comments

Comments
 (0)