Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
"
|
| 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 '
|
| 42 |
model = SopranoTTS(
|
| 43 |
-
backend="
|
| 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})
|