fuann commited on
Commit
4856a1c
·
verified ·
1 Parent(s): 93f8a11

Deploy OpenPA ONNX and WhisperX large-v3 on ZeroGPU

Browse files
Files changed (3) hide show
  1. gpu_backend.py +3 -0
  2. pre-requirements.txt +3 -0
  3. requirements.txt +1 -0
gpu_backend.py CHANGED
@@ -13,6 +13,9 @@ from huggingface_hub import snapshot_download
13
 
14
  from onnx_runtime import OpenPAOnnx
15
 
 
 
 
16
  MODEL_CACHE = os.getenv("HF_HOME", "/tmp/openpa-hf")
17
  MODEL_REVISION = "13a4f4d027c66bf78c36f58f7cf77b06becb67c0"
18
  ASR_REVISION = "edaa852ec7e145841d8ffdb056a99866b5f0a478"
 
13
 
14
  from onnx_runtime import OpenPAOnnx
15
 
16
+ if "CUDAExecutionProvider" not in ort.get_available_providers():
17
+ raise RuntimeError("CUDA ONNX Runtime wheel was overwritten by a CPU-only installation")
18
+
19
  MODEL_CACHE = os.getenv("HF_HOME", "/tmp/openpa-hf")
20
  MODEL_REVISION = "13a4f4d027c66bf78c36f58f7cf77b06becb67c0"
21
  ASR_REVISION = "edaa852ec7e145841d8ffdb056a99866b5f0a478"
pre-requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # faster-whisper requires the CPU distribution by name. Install it first so the
2
+ # later onnxruntime-gpu wheel supplies the shared Python module and CUDA binaries.
3
+ onnxruntime==1.23.2
requirements.txt CHANGED
@@ -2,6 +2,7 @@ torch==2.8.0
2
  torchaudio==2.8.0
3
  huggingface-hub==1.27.0
4
  onnxruntime-gpu==1.23.2
 
5
  transformers==5.15.0
6
  whisperx==3.7.4
7
  numpy>=2.0.2,<2.1
 
2
  torchaudio==2.8.0
3
  huggingface-hub==1.27.0
4
  onnxruntime-gpu==1.23.2
5
+ onnxruntime==1.23.2
6
  transformers==5.15.0
7
  whisperx==3.7.4
8
  numpy>=2.0.2,<2.1