Skip to content

Commit f4e29fb

Browse files
committed
list_supported_models type fix
1 parent f1393d1 commit f4e29fb

19 files changed

+26
-20
lines changed

fastembed/image/image_embedding.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
from fastembed.common import ImageInput, OnnxProvider
55
from fastembed.image.image_embedding_base import ImageEmbeddingBase
66
from fastembed.image.onnx_embedding import OnnxImageEmbedding
7+
from fastembed.common.model_description import ModelDescription
78

89

910
class ImageEmbedding(ImageEmbeddingBase):
1011
EMBEDDINGS_REGISTRY: list[Type[ImageEmbeddingBase]] = [OnnxImageEmbedding]
1112

1213
@classmethod
13-
def list_supported_models(cls) -> list[dict[str, Any]]:
14+
def list_supported_models(cls) -> list[ModelDescription]:
1415
"""
1516
Lists the supported models.
1617

fastembed/image/onnx_embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def load_onnx_model(self) -> None:
137137
)
138138

139139
@classmethod
140-
def list_supported_models(cls) -> list[dict[str, Any]]:
140+
def list_supported_models(cls) -> list[ModelDescription]:
141141
"""
142142
Lists the supported models.
143143

fastembed/late_interaction/colbert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def _tokenize_documents(self, documents: list[str]) -> list[Encoding]:
108108
return encoded
109109

110110
@classmethod
111-
def list_supported_models(cls) -> list[dict[str, Any]]:
111+
def list_supported_models(cls) -> list[ModelDescription]:
112112
"""Lists the supported models.
113113
114114
Returns:

fastembed/late_interaction/jina_colbert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _get_worker_class(cls) -> Type[ColbertEmbeddingWorker]:
2929
return JinaColbertEmbeddingWorker
3030

3131
@classmethod
32-
def list_supported_models(cls) -> list[dict[str, Any]]:
32+
def list_supported_models(cls) -> list[ModelDescription]:
3333
"""Lists the supported models.
3434
3535
Returns:

fastembed/late_interaction/late_interaction_text_embedding.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
from fastembed.late_interaction.late_interaction_embedding_base import (
88
LateInteractionTextEmbeddingBase,
99
)
10+
from fastembed.common.model_description import ModelDescription
1011

1112

1213
class LateInteractionTextEmbedding(LateInteractionTextEmbeddingBase):
1314
EMBEDDINGS_REGISTRY: list[Type[LateInteractionTextEmbeddingBase]] = [Colbert, JinaColbert]
1415

1516
@classmethod
16-
def list_supported_models(cls) -> list[dict[str, Any]]:
17+
def list_supported_models(cls) -> list[ModelDescription]:
1718
"""
1819
Lists the supported models.
1920
@@ -37,7 +38,7 @@ def list_supported_models(cls) -> list[dict[str, Any]]:
3738
]
3839
```
3940
"""
40-
result: list[dict[str, Any]] = []
41+
result: list[ModelDescription] = []
4142
for embedding in cls.EMBEDDINGS_REGISTRY:
4243
result.extend(embedding.list_supported_models())
4344
return result

fastembed/late_interaction_multimodal/colpali.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def __init__(
108108
self.load_onnx_model()
109109

110110
@classmethod
111-
def list_supported_models(cls) -> list[dict[str, Any]]:
111+
def list_supported_models(cls) -> list[ModelDescription]:
112112
"""Lists the supported models.
113113
114114
Returns:

fastembed/late_interaction_multimodal/late_interaction_multimodal_embedding.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
from fastembed.late_interaction_multimodal.late_interaction_multimodal_embedding_base import (
88
LateInteractionMultimodalEmbeddingBase,
99
)
10+
from fastembed.common.model_description import ModelDescription
1011

1112

1213
class LateInteractionMultimodalEmbedding(LateInteractionMultimodalEmbeddingBase):
1314
EMBEDDINGS_REGISTRY: list[Type[LateInteractionMultimodalEmbeddingBase]] = [ColPali]
1415

1516
@classmethod
16-
def list_supported_models(cls) -> list[dict[str, Any]]:
17+
def list_supported_models(cls) -> list[ModelDescription]:
1718
"""
1819
Lists the supported models.
1920

fastembed/rerank/cross_encoder/onnx_text_cross_encoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272

7373
class OnnxTextCrossEncoder(TextCrossEncoderBase, OnnxCrossEncoderModel):
7474
@classmethod
75-
def list_supported_models(cls) -> list[dict[str, Any]]:
75+
def list_supported_models(cls) -> list[ModelDescription]:
7676
"""Lists the supported models.
7777
7878
Returns:

fastembed/rerank/cross_encoder/text_cross_encoder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from fastembed.common import OnnxProvider
44
from fastembed.rerank.cross_encoder.onnx_text_cross_encoder import OnnxTextCrossEncoder
55
from fastembed.rerank.cross_encoder.text_cross_encoder_base import TextCrossEncoderBase
6+
from fastembed.common.model_description import ModelDescription
67

78

89
class TextCrossEncoder(TextCrossEncoderBase):
@@ -11,7 +12,7 @@ class TextCrossEncoder(TextCrossEncoderBase):
1112
]
1213

1314
@classmethod
14-
def list_supported_models(cls) -> list[dict[str, Any]]:
15+
def list_supported_models(cls) -> list[ModelDescription]:
1516
"""Lists the supported models.
1617
1718
Returns:

fastembed/sparse/bm25.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def __init__(
147147
self.tokenizer = SimpleTokenizer
148148

149149
@classmethod
150-
def list_supported_models(cls) -> list[dict[str, Any]]:
150+
def list_supported_models(cls) -> list[SparseModelDescription]:
151151
"""Lists the supported models.
152152
153153
Returns:

0 commit comments

Comments
 (0)