INNER CODE UNIT · Python

is_colab

huggingface/autotrain-advanced · src/autotrain/__init__.py:51

def is_colab():
    try:
        import google.colab

        return True
    except ImportError:
        return False


def is_unsloth_available():
    try:
        from unsloth import FastLanguageModel

        return True
    except Exception as e:
        logger.warning("Unsloth not available, continuing without it")
        logger.warning(e)
        return False

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…