[Admin maintenance] Support new ZeroGPU hardware

#5
by multimodalart HF Staff - opened
Files changed (2) hide show
  1. app.py +5 -4
  2. requirements.txt +5 -8
app.py CHANGED
@@ -250,12 +250,13 @@ def generate_audio(
250
  gr.Warning(t(ui_lang, "warn_prompt_missing"))
251
  return (target_sr, default_data)
252
 
253
- info = torchaudio.info(prompt_wav)
254
- if info.sample_rate < prompt_sr:
255
- gr.Warning(t(ui_lang, "warn_prompt_sr_low").format(info.sample_rate, prompt_sr))
 
256
  return (target_sr, default_data)
257
 
258
- if info.num_frames / info.sample_rate > 10:
259
  gr.Warning(t(ui_lang, "warn_prompt_too_long_10s"))
260
  return (target_sr, default_data)
261
 
 
250
  gr.Warning(t(ui_lang, "warn_prompt_missing"))
251
  return (target_sr, default_data)
252
 
253
+ import soundfile as _sf
254
+ info = _sf.info(prompt_wav)
255
+ if info.samplerate < prompt_sr:
256
+ gr.Warning(t(ui_lang, "warn_prompt_sr_low").format(info.samplerate, prompt_sr))
257
  return (target_sr, default_data)
258
 
259
+ if info.frames / info.samplerate > 10:
260
  gr.Warning(t(ui_lang, "warn_prompt_too_long_10s"))
261
  return (target_sr, default_data)
262
 
requirements.txt CHANGED
@@ -1,20 +1,18 @@
1
- --extra-index-url https://download.pytorch.org/whl/cu121
2
  --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ # https://github.com/microsoft/onnxruntime/issues/21684
3
  --extra-index-url https://pypi.nvidia.com
4
  --trusted-host download.pytorch.org
5
  --trusted-host aiinfra.pkgs.visualstudio.com
6
  --trusted-host pypi.nvidia.com
7
  conformer==0.3.2
8
- deepspeed==0.15.1; sys_platform == 'linux'
9
  diffusers==0.29.0
10
  fastapi==0.115.6
11
  fastapi-cli==0.0.4
12
  gdown==5.1.0
13
- gradio==5.4.0
14
  grpcio==1.57.0
15
  grpcio-tools==1.57.0
16
  hydra-core==1.3.2
17
  HyperPyYAML==1.2.2
 
18
  inflect==7.3.1
19
  librosa==0.10.2
20
  lightning==2.2.4
@@ -25,10 +23,9 @@ omegaconf==2.3.0
25
  onnx==1.16.0
26
  onnxruntime-gpu==1.18.0; sys_platform == 'linux'
27
  onnxruntime==1.18.0; sys_platform == 'darwin' or sys_platform == 'win32'
28
- openai-whisper==20231117
29
  protobuf==4.25
30
  pyarrow==18.1.0
31
- pydantic==2.7.0
32
  pyworld==0.3.4
33
  rich==13.7.1
34
  soundfile==0.12.1
@@ -36,10 +33,10 @@ tensorboard==2.14.0
36
  tensorrt-cu12==10.13.3.9; sys_platform == 'linux'
37
  tensorrt-cu12-bindings==10.13.3.9; sys_platform == 'linux'
38
  tensorrt-cu12-libs==10.13.3.9; sys_platform == 'linux'
39
- torch==2.2.2
40
- torchaudio==2.2.2
 
41
  transformers==4.51.3
42
- uvicorn==0.30.0
43
  wetext==0.0.4
44
  wget==3.2
45
  funasr==1.2.0
 
 
1
  --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ # https://github.com/microsoft/onnxruntime/issues/21684
2
  --extra-index-url https://pypi.nvidia.com
3
  --trusted-host download.pytorch.org
4
  --trusted-host aiinfra.pkgs.visualstudio.com
5
  --trusted-host pypi.nvidia.com
6
  conformer==0.3.2
 
7
  diffusers==0.29.0
8
  fastapi==0.115.6
9
  fastapi-cli==0.0.4
10
  gdown==5.1.0
 
11
  grpcio==1.57.0
12
  grpcio-tools==1.57.0
13
  hydra-core==1.3.2
14
  HyperPyYAML==1.2.2
15
+ ruamel.yaml<0.18
16
  inflect==7.3.1
17
  librosa==0.10.2
18
  lightning==2.2.4
 
23
  onnx==1.16.0
24
  onnxruntime-gpu==1.18.0; sys_platform == 'linux'
25
  onnxruntime==1.18.0; sys_platform == 'darwin' or sys_platform == 'win32'
26
+ openai-whisper
27
  protobuf==4.25
28
  pyarrow==18.1.0
 
29
  pyworld==0.3.4
30
  rich==13.7.1
31
  soundfile==0.12.1
 
33
  tensorrt-cu12==10.13.3.9; sys_platform == 'linux'
34
  tensorrt-cu12-bindings==10.13.3.9; sys_platform == 'linux'
35
  tensorrt-cu12-libs==10.13.3.9; sys_platform == 'linux'
36
+ torch==2.10.0
37
+ torchaudio==2.10.0
38
+ torchcodec==0.10
39
  transformers==4.51.3
 
40
  wetext==0.0.4
41
  wget==3.2
42
  funasr==1.2.0