KasugaiSakura commited on
Commit
8dd85c3
1 Parent(s): 58fbdee

Add cuda device check

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -10,6 +10,7 @@ import gradio as gr
10
  import librosa
11
  import numpy as np
12
  import soundfile
 
13
 
14
  from edgetts.tts_voices import SUPPORTED_LANGUAGES
15
  from inference.infer_tool import Svc
@@ -163,6 +164,10 @@ if __name__ == "__main__":
163
  parser.add_argument("-t", "--temp", default="./workspace")
164
  args = parser.parse_args()
165
 
 
 
 
 
166
  shutil.rmtree(args.temp, ignore_errors=True)
167
  os.makedirs(args.temp, exist_ok=True)
168
  TEMPDIR = args.temp
 
10
  import librosa
11
  import numpy as np
12
  import soundfile
13
+ import torch
14
 
15
  from edgetts.tts_voices import SUPPORTED_LANGUAGES
16
  from inference.infer_tool import Svc
 
164
  parser.add_argument("-t", "--temp", default="./workspace")
165
  args = parser.parse_args()
166
 
167
+ print(f"Is CUDA available: {torch.cuda.is_available()}")
168
+ if torch.cuda.is_available():
169
+ print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
170
+
171
  shutil.rmtree(args.temp, ignore_errors=True)
172
  os.makedirs(args.temp, exist_ok=True)
173
  TEMPDIR = args.temp