File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 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" ]
You can’t perform that action at this time.
0 commit comments