def _validate_modalities_match_model_location(cls, values):
        """Validate that the supported modalities match the model location. We skip the check for text and tokenizers
        as they are not required.

        Each modality must have a corresponding location in the model location, except for text and language modalities.
        """
        model_location = values.get("modelLocation")
        if model_location is not None:
            supported_modalities = values.get("supportedModalities")
            for supported_modality in supported_modalities:
                if supported_modality not in [Modality.TEXT, "test"]: # Skip text
                    if not getattr(model_location, supported_modality.lower()):
                        raise ValueError(f"Mismatch between supported modalities and model location. The supported "
                                         f"modality {supported_modality} does not have a corresponding modelLocation "
                                         f"in the model")
        return values
Validate that the supported modalities match the model location. We skip the check for text and tokenizers
        as they are not required.

        Each modality must have a corresponding location in the model location, except for text and language modalities.
        
src/marqo/inference/native_inference/embedding_models/languagebind_model_properties.py