def _load_model(
        model_name: str, model_properties: dict, device: str,
        calling_func: str = None, model_auth: Optional[ModelAuth] = None
) -> Any:
    """_summary_

    Args:
        model_name (str): Actual model_name to be fetched from external library
                        prefer passing it in the form of model_properties['name']
        device (str): Required. Should always be passed when loading model
        model_auth: Authorisation details for downloading a model (if required)

    Returns:
        Any: _description_
    """
    if calling_func not in ["unit_test", "_update_available_models"]:
        raise RuntimeError(f"The function `{_load_model.__name__}` should only be called by "
                           f"`unit_test` or `_update_available_models` for threading safeness.")

    print(f"loading for: model_name={model_name} and properties={model_properties}")

    model_type = model_properties.get("type")

    if model_type not in (
            ModelType.OpenCLIP, ModelType.HF_MODEL, ModelType.HF_STELLA, ModelType.LanguageBind,
            ModelType.Random, ModelType.MultilingualClip, ModelType.NO_MODEL
    ):
        raise ModelError(
            f"The provided model properties does not contain a valid model type. We only support "
            f"{ModelType.OpenCLIP}, {ModelType.HF_MODEL}, {ModelType.HF_STELLA}, "
            f"{ModelType.LanguageBind}, {ModelType.Random}, {ModelType.MultilingualClip}, "
            f"{ModelType.NO_MODEL} at the moment, but received {model_type}."
        )

    loader = _get_model_loader(model_properties.get('name', None), model_properties)

    model = loader(
        device=device,
        model_properties=model_properties,
        model_auth=model_auth,
    )

    model.load()
    return model
_summary_

    Args:
        model_name (str): Actual model_name to be fetched from external library
                        prefer passing it in the form of model_properties['name']
        device (str): Required. Should always be passed when loading model
        model_auth: Authorisation details for downloading a model (if required)

    Returns:
        Any: _description_
    
src/marqo/inference/native_inference/load_model.py