mirror of
https://github.com/rakuri255/UltraSinger.git
synced 2026-11-28 01:48:56 +09:00
14 lines
475 B
Python
14 lines
475 B
Python
from moduls.Log import PRINT_ULTRASTAR, print_red_highlighted_text
|
|
import torch
|
|
|
|
def get_available_device():
|
|
isCuda = torch.cuda.is_available()
|
|
|
|
if not isCuda:
|
|
print("{} There are no {} devices available. -> Using {}.".format(PRINT_ULTRASTAR, print_red_highlighted_text("cuda"), print_red_highlighted_text("cpu")))
|
|
return "cpu"
|
|
else:
|
|
print("{} Using {} GPU.".format(PRINT_ULTRASTAR, print_red_highlighted_text("cuda")))
|
|
|
|
return "cuda"
|