Nymbo commited on
Commit
5904dfc
·
verified ·
1 Parent(s): 1528054

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -31,16 +31,15 @@ def _init_soprano() -> None:
31
 
32
  if not torch or not torch.cuda.is_available():
33
  raise gr.Error(
34
- "Soprano requires a CUDA GPU. PyTorch CUDA not detected. "
35
- "Please install CUDA-enabled PyTorch: pip install torch --index-url https://download.pytorch.org/whl/cu121"
36
  )
37
 
38
  device = "cuda"
39
  print(f"Using device: {device}")
40
 
41
- # Use 'transformers' backend for compatibility (lmdeploy requires ray which isn't on Windows)
42
  model = SopranoTTS(
43
- backend="transformers",
44
  device=device,
45
  )
46
  _SOPRANO_STATE.update({"initialized": True, "device": device, "model": model})
 
31
 
32
  if not torch or not torch.cuda.is_available():
33
  raise gr.Error(
34
+ "Currently running on CPU. Soprano requires a GPU."
 
35
  )
36
 
37
  device = "cuda"
38
  print(f"Using device: {device}")
39
 
40
+ # Use 'auto' backend: uses lmdeploy if available (faster), falls back to transformers
41
  model = SopranoTTS(
42
+ backend="auto",
43
  device=device,
44
  )
45
  _SOPRANO_STATE.update({"initialized": True, "device": device, "model": model})