def test_vectorize(self):
        """
        Ensure that vectorised output from vectorise function matches both the model.encode output and
        hardcoded embeddings from Python 3.8.20
        """

        names = ["fp16/ViT-B/32", "onnx16/open_clip/ViT-B-32/laion400m_e32", 'onnx32/open_clip/ViT-B-32-quickgelu/laion400m_e32',
                 "all-MiniLM-L6-v1", "all_datasets_v4_MiniLM-L6", "hf/all-MiniLM-L6-v1", "hf/all_datasets_v4_MiniLM-L6",
                 "hf/bge-small-en-v1.5", "onnx/all-MiniLM-L6-v1", "onnx/all_datasets_v4_MiniLM-L6"]

        names_e5 = ["hf/e5-small", "hf/e5-base", "hf/e5-small-unsupervised", "hf/e5-base-unsupervised", "hf/e5-base-v2", "intfloat/e5-base-v2",
                    "hf/multilingual-e5-small", "intfloat/multilingual-e5-small", "intfloat/multilingual-e5-large", "intfloat/e5-large-v2",
                    "intfloat/e5-small-v2", "intfloat/multilingual-e5-base"]

        names_bge = ["hf/bge-small-en-v1.5", "hf/bge-base-en-v1.5", "BAAI/bge-base-en-v1.5",  "BAAI/bge-large-en-v1.5"]

        names_snowflake = ["hf/snowflake-arctic-embed-m", "hf/snowflake-arctic-embed-m-v1.5"]
        names = names + names_e5 + names_bge + names_snowflake

        sentences = ['hello', 'this is a test sentence. so is this.', ['hello', 'this is a test sentence. so is this.']]
        device = 'cpu'
        eps = 1e-9
        embeddings_file_name = get_absolute_file_path(
            "../inference/embeddings_reference/embeddings_all_models_python_3_8.json")

        # Load in hardcoded embeddings json file
        with open(embeddings_file_name, "r") as f:
            embeddings_python_3_8 = json.load(f)

        for name in names:
            with self.subTest(name=name):
                # Add hardcoded embeddings into the variable.
                model_properties = get_model_properties_from_registry(name)
                model = _load_model(model_properties['name'], model_properties=model_properties, device=device)

                for sentence in sentences:
                    with self.subTest(sentence=sentence):
                        output_v = vectorise(name, sentence, model_properties, device, normalize_embeddings=True)
                        assert _check_output_type(output_v)

                        output_m = model.encode(sentence, normalize=True)

                        # Embeddings must match hardcoded python 3.8.20 embeddings
                        if isinstance(sentence, str):
                            with self.subTest("Hardcoded Python 3.8 Embeddings Comparison"):
                                try:
                                    self.assertEqual(np.allclose(output_m, embeddings_python_3_8[name][sentence],
                                                                 atol=1e-6),
                                                 True, f"Calculated embeddings do not match hardcoded embeddings for model: {name}, sentence: {sentence}. Printing output: {output_m}")
                                except KeyError:
                                    raise KeyError(f"Hardcoded Python 3.8 embeddings not found for "
                                                   f"model: {name}, sentence: {sentence} in JSON file: "
                                                   f"{embeddings_file_name}")

                        with self.subTest("Model encode vs vectorize"):
                            self.assertEqual(np.allclose(output_m, output_v, atol=eps), True,
                                             f"Hardcoded embeddings do not match for {name}:{sentence}")

                clear_loaded_models()

        Ensure that vectorised output from vectorise function matches both the model.encode output and
        hardcoded embeddings from Python 3.8.20
        
tests/integ_tests/s2_inference/test_encoding.py