Skip to content

Commit 7845d98

Browse files
authored
Delete no model tests (#301)
1 parent 8923d46 commit 7845d98

File tree

3 files changed

+2
-120
lines changed

3 files changed

+2
-120
lines changed

tests/cloud_test_logic/cloud_test_index.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ class CloudTestIndex(str, Enum):
1111
1212
1) unstructured_text: Text-only index using hf/e5-base-v2, 2 shards, 1 replica, CPU, balanced storage, for hybrid duplicates testing.
1313
2) unstructured_image: Image-compatible index using open_clip/ViT-B-32/laion2b_s34b_b79k, 1 shard, no replicas, CPU, basic storage.
14-
3) unstructured_no_model: 512-dimension custom vectors, 1 shard, no replicas, CPU, basic storage.
15-
4) structured_text: Structured text index with hf/e5-base-v2, lexical search, 2 shards, 1 replica, CPU, balanced storage.
16-
5) structured_image: Structured image-text index with open_clip/ViT-B-32, 2 shards, 1 replica, CPU, balanced storage, with image preprocessing.
14+
3) structured_text: Structured text index with hf/e5-base-v2, lexical search, 2 shards, 1 replica, CPU, balanced storage.
15+
4) structured_image: Structured image-text index with open_clip/ViT-B-32, 2 shards, 1 replica, CPU, balanced storage, with image preprocessing.
1716
For more information on the settings of each index, please refer to index_name_to_settings_mappings.
1817
1918
FOR CLOUD REPLICAS AND SHARDS:
@@ -28,7 +27,6 @@ class CloudTestIndex(str, Enum):
2827
unstructured_text = "pymarqo_unstr_txt"
2928
unstructured_image = "pymarqo_unstr_img"
3029
unstructured_text_custom_prepro = "pymarqo_unstr_txt_cstm_pre"
31-
unstructured_no_model = "pymarqo_unstr_no_model"
3230

3331
structured_image_prepro = "pymarqo_str_img_prepro"
3432
structured_image_custom = "pymarqo_str_img_custom"
@@ -57,21 +55,6 @@ class CloudTestIndex(str, Enum):
5755
"numberOfShards": 1,
5856
"numberOfReplicas": 0,
5957
},
60-
CloudTestIndex.unstructured_no_model: {
61-
"type": "unstructured",
62-
"treatUrlsAndPointersAsImages": False,
63-
64-
"inferenceType": "marqo.CPU.small",
65-
"storageClass": "marqo.basic",
66-
"numberOfShards": 1,
67-
"numberOfReplicas": 0,
68-
69-
"model": "no_model",
70-
"modelProperties": {
71-
"type": "no_model",
72-
"dimensions": 512
73-
},
74-
},
7558
CloudTestIndex.structured_text: {
7659
"type": "structured",
7760
"model": "hf/e5-base-v2",

tests/marqo_test.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ def setUpClass(cls) -> None:
206206
cls.structured_index_name = "structured_index"
207207
cls.structured_image_index_name = "structured_image_index"
208208
cls.unstructured_image_index_name = "unstructured_image_index"
209-
cls.unstructured_no_model_index_name = "unstructured_no_model_index"
210209
cls.structured_image_index_name_simple_preprocessing_method = \
211210
"structured_image_index_simple_preprocessing_method"
212211

@@ -254,16 +253,6 @@ def setUpClass(cls) -> None:
254253
"tensorFields": ["text_field_1", "text_field_2", "text_field_3", "image_field_1"],
255254
"model": "open_clip/ViT-B-32/laion400m_e32",
256255
},
257-
{
258-
"indexName": cls.unstructured_no_model_index_name,
259-
"type": "unstructured",
260-
"model": "no_model",
261-
"treatUrlsAndPointersAsImages": True,
262-
"modelProperties": {
263-
"type": "no_model",
264-
"dimensions": 512
265-
}
266-
},
267256
])
268257
except Exception as e:
269258
print("Error creating indexes: ", e)

tests/v2_tests/test_add_documents.py

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -573,96 +573,6 @@ def test_custom_vector_doc(self):
573573
assert doc_res['_tensor_facets'][0]["my_custom_vector"] == "custom vector text"
574574
assert (np.linalg.norm(np.array(doc_res['_tensor_facets'][0]['_embedding'])) - 1) < 1e-6
575575

576-
def test_no_model_custom_vector_doc(self):
577-
"""
578-
Tests the `no_model` index model and searching with no `q` parameter.
579-
Executed on documents with custom_vector field type.
580-
581-
Ensures the following features work on this index:
582-
1. lexical search
583-
2. filter string search
584-
3. tensor search
585-
4. bulk search
586-
5. get document
587-
588-
Note: `no_model` is not yet supported on Cloud.
589-
"""
590-
self.test_cases = [(CloudTestIndex.unstructured_no_model, self.unstructured_no_model_index_name)]
591-
592-
for cloud_test_index_to_use, open_source_test_index_name in self.test_cases:
593-
test_index_name = self.get_test_index_name(
594-
cloud_test_index_to_use=cloud_test_index_to_use,
595-
open_source_test_index_name=open_source_test_index_name
596-
)
597-
598-
DIMENSION = 512
599-
custom_vector_1 = np.random.rand(DIMENSION)
600-
custom_vector_1 = (custom_vector_1 / np.linalg.norm(custom_vector_1)).tolist()
601-
custom_vector_2 = np.random.rand(DIMENSION)
602-
custom_vector_2 = (custom_vector_2 / np.linalg.norm(custom_vector_2)).tolist()
603-
custom_vector_3 = np.random.rand(DIMENSION)
604-
custom_vector_3 = (custom_vector_3 / np.linalg.norm(custom_vector_3)).tolist()
605-
606-
self.client.index(index_name=test_index_name).add_documents(
607-
documents=[
608-
{
609-
"my_custom_vector": {
610-
"content": "custom vector text",
611-
"vector": custom_vector_1,
612-
},
613-
"_id": "doc1",
614-
},
615-
{
616-
"my_custom_vector": {
617-
"content": "second text",
618-
"vector": custom_vector_2,
619-
},
620-
"_id": "doc2",
621-
},
622-
{
623-
"my_custom_vector": {
624-
"content": "third text",
625-
"vector": custom_vector_3,
626-
},
627-
"_id": "doc3",
628-
},
629-
], mappings={
630-
"my_custom_vector": {
631-
"type": "custom_vector"
632-
}
633-
},
634-
tensor_fields=["my_custom_vector"])
635-
636-
# lexical search test
637-
if self.IS_MULTI_INSTANCE:
638-
self.warm_request(self.client.index(test_index_name).search,
639-
"custom vector text", search_method="lexical")
640-
641-
lexical_res = self.client.index(test_index_name).search(
642-
"custom vector text", search_method="lexical")
643-
self.assertEqual("doc1", lexical_res["hits"][0]["_id"])
644-
645-
# filter string test
646-
if self.IS_MULTI_INSTANCE:
647-
self.warm_request(self.client.index(test_index_name).search,
648-
context={"tensor": [{"vector": custom_vector_2, "weight": 1}]},
649-
filter_string="my_custom_vector:(second text)")
650-
651-
filtering_res = self.client.index(test_index_name).search(
652-
context={"tensor": [{"vector": custom_vector_2, "weight": 1}]}, # no text query
653-
filter_string="my_custom_vector:(second text)")
654-
self.assertEqual("doc2", filtering_res["hits"][0]["_id"])
655-
656-
# tensor search test
657-
if self.IS_MULTI_INSTANCE:
658-
self.warm_request(self.client.index(test_index_name).search,
659-
context={"tensor": [{"vector": custom_vector_3, "weight": 1}]})
660-
661-
tensor_res = self.client.index(test_index_name).search(
662-
context={"tensor": [{"vector": custom_vector_3, "weight": 1}]} # no text query
663-
)
664-
self.assertEqual("doc3", tensor_res["hits"][0]["_id"])
665-
666576
def test_add_docs_image_download_headers(self):
667577
mock__post = mock.MagicMock()
668578

0 commit comments

Comments
 (0)