Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkkul committed Aug 19, 2024
1 parent 7affa78 commit e0c4df9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
26 changes: 26 additions & 0 deletions test/collection/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,18 @@ def test_basic_config():
}
},
),
(
Configure.Vectorizer.text2vec_mistral(
vectorize_collection_name=False,
model="cool-model",
),
{
"text2vec-mistral": {
"vectorizeClassName": False,
"model": "cool-model",
}
},
),
(
Configure.Vectorizer.text2vec_palm(
project_id="project",
Expand Down Expand Up @@ -1185,6 +1197,20 @@ def test_vector_config_flat_pq() -> None:
}
},
),
(
[Configure.NamedVectors.text2vec_mistral(name="test", source_properties=["prop"])],
{
"test": {
"vectorizer": {
"text2vec-mistral": {
"vectorizeClassName": True,
"properties": ["prop"],
}
},
"vectorIndexType": "hnsw",
}
},
),
(
[
Configure.NamedVectors.text2vec_palm(
Expand Down
5 changes: 5 additions & 0 deletions test/collection/test_vectorizer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from weaviate.collections.classes.config import Configure


def test_multi2vec_clip() -> None:
Configure.Vectorizer.multi2vec_clip(image_fields=["test"])
2 changes: 1 addition & 1 deletion weaviate/collections/classes/config_vectorizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class _Text2VecHuggingFaceConfigCreate(_Text2VecHuggingFaceConfig, _VectorizerCo


class _Text2VecMistralConfig(_VectorizerConfigCreate):
vectorizer: Vectorizers = Field(default=Vectorizers.TEXT2VEC_MISTRAL, frozen=True, exclude=True)
vectorizer: Union[Vectorizers, _EnumLikeStr] = Field(default=Vectorizers.TEXT2VEC_MISTRAL, frozen=True, exclude=True)
model: Optional[str]
vectorizeClassName: bool

Expand Down

0 comments on commit e0c4df9

Please sign in to comment.