def is_supported_hdbscan(model):
    """Check whether the input model is a supported HDBSCAN-like model."""
    try:
        import hdbscan
    except (ImportError, ModuleNotFoundError):
        hdbscan = type("hdbscan", (), {"HDBSCAN": None})()

    if isinstance(model, hdbscan.HDBSCAN):
        return True

    str_type_model = str(type(model)).lower()
    if "cuml" in str_type_model and "hdbscan" in str_type_model:
        return True

    return False
Check whether the input model is a supported HDBSCAN-like model.
bertopic/cluster/_utils.py