Skip to content

Commit 954dc70

Browse files
committed
test: add test for list supported models
1 parent 997272c commit 954dc70

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/test_common.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from fastembed import (
2+
TextEmbedding,
3+
SparseTextEmbedding,
4+
ImageEmbedding,
5+
LateInteractionMultimodalEmbedding,
6+
LateInteractionTextEmbedding,
7+
)
8+
9+
10+
def test_text_list_supported_models():
11+
for model_type in [
12+
TextEmbedding,
13+
SparseTextEmbedding,
14+
ImageEmbedding,
15+
LateInteractionMultimodalEmbedding,
16+
LateInteractionTextEmbedding,
17+
]:
18+
supported_models = model_type.list_supported_models()
19+
assert isinstance(supported_models, list)
20+
description = supported_models[0]
21+
assert isinstance(description, dict)
22+
23+
assert "model" in description and description["model"]
24+
if model_type != SparseTextEmbedding:
25+
assert "dim" in description and description["dim"]
26+
assert "license" in description and description["license"]
27+
assert "size_in_GB" in description and description["size_in_GB"]
28+
assert "model_file" in description and description["model_file"]
29+
assert "sources" in description and description["sources"]
30+
assert "hf" in description["sources"] or "url" in description["sources"]

0 commit comments

Comments
 (0)