interview-ai-detector / device_manager.py
bearking58's picture
feat: finalize pipeline
b4f3263
raw
history blame
330 Bytes
import torch
class DeviceManager:
_instance = None
def __new__(cls):
if cls._instance is None:
cls._instance = super(DeviceManager, cls).__new__(cls)
cls._instance.device = torch.device(
"cuda" if torch.cuda.is_available() else "cpu")
return cls._instance.device