mirror of
https://github.com/wassname/TTS.git
synced 2026-09-10 11:50:20 +08:00
add get_cuda()
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
import datetime
|
||||
import glob
|
||||
@@ -8,10 +7,17 @@ import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import torch
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
|
||||
def get_cuda():
|
||||
use_cuda = torch.cuda.is_available()
|
||||
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
||||
return use_cuda, device
|
||||
|
||||
|
||||
def get_git_branch():
|
||||
try:
|
||||
out = subprocess.check_output(["git", "branch"]).decode("utf8")
|
||||
|
||||
Reference in New Issue
Block a user