def validate_model_properties(model_name: str, model_properties: dict) -> dict:
    """validate model_properties, if not given then return model_registry properties.

    This is a rough validation as it only checks the minimum required fields and dimensions values. More indepth
    check should be done when loading the model.

    Raises:
        InvalidModelPropertiesError: if the model_properties are invalid
        UnknownModelError: if the model_name is not in the model registry
    """
    if model_properties is not None:
        """checks model dict to see if all required keys are present
        """
        required_keys = []

        if "type" not in model_properties:
            error_message_postfix = "Marqo is loading the model with default type 'sbert' as the type was not provided."
        else:
            error_message_postfix = ""

        model_type = model_properties.get("type", None)

        if model_type in (None, ModelType.SBERT):
            required_keys = ["dimensions", "name"]
            # updates model dict with default values if optional keys are missing for sbert
            optional_keys_values = [("type", ModelType.SBERT), ("tokens", get_default_seq_length())]
            for key, value in optional_keys_values:
                if key not in model_properties:
                    model_properties[key] = value
        elif model_type in (ModelType.OpenCLIP, ModelType.CLIP):
            required_keys = ["name", "dimensions"]
        elif model_type in (ModelType.HF_MODEL, ModelType.HF_STELLA):
            required_keys = ["dimensions"]
        elif model_type in (ModelType.NO_MODEL,):
            required_keys = ["dimensions"]
            if not model_name == "no_model":
                raise InvalidModelPropertiesError(f"To use the 'no_model' feature, you must provide 'model = no_model' "
                                                  f"and 'type = no_model', but received 'model = {model_name}' and "
                                                  f"'type = {model_type}'.")
        elif model_type in (ModelType.Test, ModelType.Random, ModelType.MultilingualClip, ModelType.FP16_CLIP,
                            ModelType.SBERT_ONNX, ModelType.CLIP_ONNX, ModelType.LanguageBind):
            pass
        else:
            raise InvalidModelPropertiesError(f"Invalid model type. Please check the model type in model_properties. "
                                              f"Supported model types are '{ModelType.SBERT}', '{ModelType.OpenCLIP}', "
                                              f"'{ModelType.CLIP}', '{ModelType.HF_MODEL}', '{ModelType.HF_STELLA}', "
                                              f"'{ModelType.NO_MODEL}', "
                                              f"'{ModelType.Test}', '{ModelType.Random}', "
                                              f"'{ModelType.MultilingualClip}', "
                                              f"'{ModelType.FP16_CLIP}', '{ModelType.SBERT_ONNX}', "
                                              f"'{ModelType.CLIP_ONNX}' ")

        for key in required_keys:
            if key not in model_properties:
                raise InvalidModelPropertiesError(f"model_properties has missing key '{key}'. "
                                                  f"please update your model properties with required key `{key}`. "
                                                  f"{error_message_postfix} "
                                                  f"check {marqo_docs.list_of_models()}, "
                                                  f"{marqo_docs.bring_your_own_model()} for more info")

    else:
        model_properties = get_model_properties_from_registry(model_name)

    _validate_model_properties_dimension(model_properties.get("dimensions", None))

    return model_properties
validate model_properties, if not given then return model_registry properties.

    This is a rough validation as it only checks the minimum required fields and dimensions values. More indepth
    check should be done when loading the model.

    Raises:
        InvalidModelPropertiesError: if the model_properties are invalid
        UnknownModelError: if the model_name is not in the model registry
    
src/marqo/s2_inference/s2_inference.py