Spaces:
Running on Zero
Running on Zero
Deploy demo to HF Space
Browse files- README.md +9 -2
- __pycache__/app.cpython-312.pyc +0 -0
- app.py +1 -1
- 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
|
| 66 |
-
|
| 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
|
| 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
|
| 2 |
-
#
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
|
|
|
|
|