Spaces:
Running on Zero

mazesmazes commited on
Commit
a79e961
·
verified ·
1 Parent(s): 8e9d452

Deploy demo to HF Space

Browse files
Files changed (4) hide show
  1. README.md +9 -2
  2. __pycache__/app.cpython-312.pyc +0 -0
  3. app.py +1 -1
  4. requirements.txt +16 -5
README.md CHANGED
@@ -24,6 +24,13 @@ tags:
24
  - granite-speech
25
  - qwen3.5
26
  - lora
 
 
 
 
 
 
 
27
  ---
28
 
29
  ## Demo Overview
@@ -62,8 +69,8 @@ The model bridges audio and text with a trained projector and LoRA adapters:
62
 
63
  - Plain transcription works best on clips up to about 19 seconds (the training length); with
64
  timestamps or diarization on, longer audio is transcribed in chunks automatically
65
- - Requests run on a GPU server on RunPod; while it is starting up or offline, requests fail with a
66
- "try again" message
67
  - Optimized for English language
68
  - Best performance with clear speech and minimal background noise
69
 
 
24
  - granite-speech
25
  - qwen3.5
26
  - lora
27
+ suggested_hardware: zero-a10g
28
+ preload_from_hub:
29
+ - mazesmazes/tiny-audio
30
+ - ibm-granite/granite-speech-5.0-470m-turboctc
31
+ - Qwen/Qwen3.5-2B
32
+ - Qwen/Qwen3-ForcedAligner-0.6B-hf
33
+ - nvidia/Nemotron-3-Diarization
34
  ---
35
 
36
  ## Demo Overview
 
69
 
70
  - Plain transcription works best on clips up to about 19 seconds (the training length); with
71
  timestamps or diarization on, longer audio is transcribed in chunks automatically
72
+ - Requests run on ZeroGPU, which reserves GPU time from your daily quota in proportion to the
73
+ audio's length (20-120 s), so roughly up to five minutes of speech per request
74
  - Optimized for English language
75
  - Best performance with clear speech and minimal background noise
76
 
__pycache__/app.cpython-312.pyc CHANGED
Binary files a/__pycache__/app.cpython-312.pyc and b/__pycache__/app.cpython-312.pyc differ
 
app.py CHANGED
@@ -84,7 +84,7 @@ def gpu_seconds(audio: str, kwargs: Mapping[str, Any]) -> int:
84
  """
85
  try:
86
  seconds = soundfile.info(audio).duration
87
- except Exception: # unreadable here: let the pipeline report it, reserve the cap
88
  return 120
89
  per_second = 0.4 if kwargs.get("return_timestamps") or kwargs.get("return_speakers") else 0.2
90
  return int(min(120, max(20, 10 + per_second * seconds)))
 
84
  """
85
  try:
86
  seconds = soundfile.info(audio).duration
87
+ except (OSError, RuntimeError, TypeError): # unreadable or no audio: reserve the cap
88
  return 120
89
  per_second = 0.4 if kwargs.get("return_timestamps") or kwargs.get("return_speakers") else 0.2
90
  return int(min(120, max(20, 10 + per_second * seconds)))
requirements.txt CHANGED
@@ -1,7 +1,18 @@
1
- # The Space sends requests to a tiny-audio server on RunPod (ENDPOINT_URL, `ta serve`),
2
- # so it needs no torch or transformers. gradio itself comes from the README's sdk_version.
3
- httpx
 
 
 
 
 
 
 
4
  soundfile
 
 
 
 
 
 
5
  typer
6
- # Running the model in-process instead (no ENDPOINT_URL, e.g. `ta demo` locally)
7
- # needs the model's own dependencies: see the repo's requirements.txt.
 
1
+ # The Space runs the model in-process on ZeroGPU. gradio itself comes from the README's
2
+ # sdk_version, and `spaces` (the @spaces.GPU decorator) is preinstalled on ZeroGPU hardware.
3
+ # Speaker diarization uses Nemotron-3-Diarization, in transformers main after 5.17.
4
+ # Pinned to the commit the pipeline was verified on; move to a release once one ships it.
5
+ transformers @ git+https://github.com/huggingface/transformers@91ea1192a00e0ebb684400434375fbd2345c8449
6
+ torch
7
+ torchaudio
8
+ peft
9
+ safetensors
10
+ numpy
11
  soundfile
12
+ spaces
13
+ # Fast path for Qwen3.5's gated-delta-rule layers (transformers falls back to a
14
+ # slower reference implementation without it). Pure Triton, nothing to compile.
15
+ flash-linear-attention>=0.2.2
16
+ # Calling a `ta serve` server instead (ENDPOINT_URL set) needs only these and soundfile.
17
+ httpx
18
  typer