INNER CODE UNIT · Python

_cuda_available

bigsk1/voice-chat-ai · app/app.py:135

def _cuda_available() -> bool:
    try:
        import torch as torch_module

        return bool(torch_module.cuda.is_available())
    except ImportError:
        return False

def ensure_sparktts_available():
    global SparkTTS, SPARKTTS_AVAILABLE, torch
    if SparkTTS is not None:
        return True

    try:
        import sys
        import logging
        import warnings
        import torch as torch_module

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…