def _infer_pooling_method_from_name(name: str) -> PoolingMethod:
        """
        Infer the pooling method from the model name.
        Args:
            name: The name of the model. This is the repo_id in the Hugging Face model hub.

        Returns:
            The inferred pooling method.
        """
        repo_id = name
        file_name = "1_Pooling/config.json"

        def log_warning_and_return_default():
            logger.warning(f"Could not infer pooling method from the model {name}. Defaulting to mean pooling.")
            return PoolingMethod.Mean

        try:
            file_path = hf_hub_download(repo_id, file_name, cache_dir=ModelCache.hf_cache_path)
        except HfHubHTTPError:
            return log_warning_and_return_default()

        try:
            with open(file_path, 'r') as file:
                content = json.loads(file.read())
        except JSONDecodeError:
            return log_warning_and_return_default()

        if not isinstance(content, dict):
            return log_warning_and_return_default()

        if content.get("pooling_mode_cls_token") is True:
            return PoolingMethod.CLS
        elif content.get("pooling_mode_mean_tokens") is True:
            return PoolingMethod.Mean
        else:
            return log_warning_and_return_default()

        Infer the pooling method from the model name.
        Args:
            name: The name of the model. This is the repo_id in the Hugging Face model hub.

        Returns:
            The inferred pooling method.
        
src/marqo/inference/native_inference/embedding_models/hugging_face_model_properties.py