mirror of
https://github.com/rakuri255/UltraSinger.git
synced 2026-11-28 01:48:56 +09:00
21 lines
485 B
Python
21 lines
485 B
Python
"""Docstring"""
|
|
|
|
import torch
|
|
|
|
from modules.console_colors import ULTRASINGER_HEAD, red_highlighted
|
|
|
|
|
|
def get_available_device():
|
|
"""Docstring"""
|
|
isCuda = torch.cuda.is_available()
|
|
|
|
if not isCuda:
|
|
print(
|
|
f"{ULTRASINGER_HEAD} There are no {red_highlighted('cuda')} devices available. -> Using {red_highlighted('cpu')}."
|
|
)
|
|
|
|
return "cpu"
|
|
else:
|
|
print(f"{ULTRASINGER_HEAD} Using {red_highlighted('cuda')} GPU.")
|
|
|
|
return "cuda" |