import importlib


def is_module_available(module_name: str):
    """
    checks if a module is available or not (eg. _is_module_available("sentence_transformers"))
    Args:
        module_name (str): name of the model to check
    Returns:
        bool, if or not the given module exists
    """
    try:
        importlib.import_module(module_name)
    except Exception as e:
        # print(e)
        return False

    return True