cwenger commited on
Commit
0366bb6
·
verified ·
1 Parent(s): 923058c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -6,10 +6,12 @@ import numpy as np
6
  import gradio as gr
7
 
8
  def _grab_best_device(use_gpu=True):
9
- if torch.cuda.device_count() > 0 and use_gpu:
10
- device = "cuda"
11
- else:
12
- device = "cpu"
 
 
13
  return device
14
 
15
  device = _grab_best_device()
@@ -41,7 +43,7 @@ HUB_PATH = "ylacombe/vits_ljs_midlands_male_monospeaker"
41
 
42
  pipe_dict = {
43
  "current_model": "ylacombe/vits_ljs_midlands_male_monospeaker",
44
- "pipe": pipeline("text-to-speech", model=HUB_PATH, device=0),
45
  "original_pipe": pipeline("text-to-speech", model=default_model_per_language["english"], device=0),
46
  "language": "english",
47
  }
 
6
  import gradio as gr
7
 
8
  def _grab_best_device(use_gpu=True):
9
+ #if torch.cuda.device_count() > 0 and use_gpu:
10
+ # device = "cuda"
11
+ #else:
12
+ # device = "cpu"
13
+ device = 0 if torch.cuda.is_available() else -1
14
+
15
  return device
16
 
17
  device = _grab_best_device()
 
43
 
44
  pipe_dict = {
45
  "current_model": "ylacombe/vits_ljs_midlands_male_monospeaker",
46
+ "pipe": pipeline("text-to-speech", model=HUB_PATH, device=device),
47
  "original_pipe": pipeline("text-to-speech", model=default_model_per_language["english"], device=0),
48
  "language": "english",
49
  }