刘鑫 commited on
Commit
f15ea05
·
1 Parent(s): 59f3c75

fix: install CPU torchaudio to avoid CUDA 13 mismatch on ZeroGPU

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -5,7 +5,18 @@ import sys
5
  from pathlib import Path
6
  from typing import Optional, Tuple
7
 
8
- # Install voxcpm without deps to avoid overwriting ZeroGPU's pre-installed torch/torchaudio
 
 
 
 
 
 
 
 
 
 
 
9
  try:
10
  import voxcpm # noqa: F401
11
  except ImportError:
 
5
  from pathlib import Path
6
  from typing import Optional, Tuple
7
 
8
+ # ZeroGPU pre-installs torch (CUDA 12.x) but NOT torchaudio.
9
+ # PyPI default torchaudio links against CUDA 13 which is unavailable on ZeroGPU.
10
+ # Install CPU-only torchaudio (sufficient for audio I/O) then voxcpm without deps.
11
+ try:
12
+ import torchaudio # noqa: F401
13
+ except (ImportError, OSError):
14
+ subprocess.check_call([
15
+ sys.executable, "-m", "pip", "install", "--no-deps",
16
+ "--index-url", "https://download.pytorch.org/whl/cpu",
17
+ "torchaudio",
18
+ ])
19
+
20
  try:
21
  import voxcpm # noqa: F401
22
  except ImportError: