jefffffff9 Claude Sonnet 4.6 commited on
Commit
bfe5b59
·
1 Parent(s): 8952fff

Fix slow build: strip runtime-irrelevant heavy packages from requirements.txt

Browse files

Removed from requirements.txt (causes slow builds, unused at Space runtime):
- torch / torchaudio pins → Spaces pre-installs correct CUDA build; re-pinning
forces pip to re-download ~1 GB on every build
- f5-tts>=1.0.0 → ~2 GB install with vocos/x-transformers/jieba/einops;
src/tts/f5_tts.py already falls back to MMS-TTS on ImportError
- speechbrain → heavy ML package, speaker-id not on critical path
- peft → training-only (Kaggle notebook), removed from app pipeline
- evaluate → training-only
- bitsandbytes → quantization library, not usable on cpu-basic anyway
- audiomentations → training-time augmentation only
- pytest / pytest-asyncio → dev-only, never run in production Space

Estimated build time improvement: 10-15 min -> ~2 min

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. requirements.txt +13 -40
requirements.txt CHANGED
@@ -1,34 +1,30 @@
1
  # -----------------------------------------------------------------------------
2
- # Sahel-Agri Voice AI — Python Dependencies
3
- # HuggingFace Spaces (ZeroGPU) deployment — CUDA pre-installed, no +cu128 suffix
4
  #
5
- # Local CPU test:
6
- # pip install -r requirements.txt
 
 
 
 
 
 
 
 
 
7
  # -----------------------------------------------------------------------------
8
 
9
- # PyTorch (CPU build — works on HF Spaces cpu-basic and locally)
10
- torch==2.11.0
11
- torchaudio==2.11.0
12
-
13
  # HuggingFace core
14
  transformers==5.5.0
15
  datasets==4.8.4
16
  accelerate==1.13.0
17
- evaluate==0.4.2
18
  huggingface-hub==1.9.0
19
 
20
- # PEFT (LoRA adapters)
21
- peft==0.18.1
22
-
23
  # Audio processing
24
  librosa==0.10.2
25
  soundfile==0.12.1
26
- audiomentations==0.43.1
27
-
28
- # Quantization (CPU: installs fine; 4-bit/8-bit requires GPU at runtime)
29
- bitsandbytes==0.49.2
30
 
31
- # Metrics
32
  jiwer==3.0.4
33
 
34
  # Config & environment
@@ -41,33 +37,10 @@ python-dotenv==1.1.0
41
  # Pydantic v2
42
  pydantic==2.11.3
43
 
44
- # Testing
45
- pytest==8.3.5
46
- pytest-asyncio==0.26.0
47
-
48
  # Utilities
49
  numpy==2.2.4
50
  scipy==1.15.2
51
-
52
- # Phrase matching (fuzzy match for Whisper mis-transcriptions of Bambara/Fula)
53
  rapidfuzz==3.13.0
54
 
55
- # Voice cloning — F5-TTS (flow-matching, language-agnostic, reference-speaker)
56
- # Requires GPU at runtime (~750 MB model auto-downloaded on first use).
57
- # Falls back to MMS-TTS gracefully when not installed or GPU unavailable.
58
- f5-tts>=1.0.0
59
-
60
  # Kaggle API (used by Self-Teaching tab to trigger training runs)
61
  kaggle>=1.6.0
62
-
63
- # Speaker identification (ECAPA-TDNN 192-d embeddings, used by SpeakerProfileManager)
64
- speechbrain>=0.5.15
65
-
66
- # Voice cloning (OpenVoice V2 / myshell-openvoice) is NOT listed here.
67
- # myshell-openvoice pins librosa==0.9.1 which conflicts with our librosa==0.10.2.
68
- # VoiceCloner in src/tts/voice_cloner.py degrades gracefully (returns None) when
69
- # the package is absent — base VITS voice is used instead.
70
- # Re-enable once OpenVoice releases a version compatible with librosa>=0.10.
71
-
72
- # maliba-ai is NOT listed here — it has strict conflicting pins (librosa, soundfile).
73
- # It is installed lazily at runtime on first Bambara TTS call (see src/tts/waxal_tts.py).
 
1
  # -----------------------------------------------------------------------------
2
+ # Sahel-Agri Voice AI — HuggingFace Spaces (cpu-basic) runtime dependencies
 
3
  #
4
+ # RULES:
5
+ # - Do NOT pin torch/torchaudio — Spaces pre-installs the correct CUDA build.
6
+ # Re-pinning them forces a 1 GB re-download on every build.
7
+ # - Do NOT add training-only packages (peft, evaluate, bitsandbytes,
8
+ # audiomentations) — they are only needed in the Kaggle notebook.
9
+ # - Do NOT add dev tools (pytest, pytest-asyncio) — not run in production.
10
+ # - f5-tts is intentionally omitted — it is a ~2 GB install and is only
11
+ # needed for GPU voice cloning. src/tts/f5_tts.py falls back to MMS-TTS
12
+ # gracefully when the package is absent.
13
+ # - speechbrain is intentionally omitted — it is heavy and speaker-id is
14
+ # not on the critical path at runtime.
15
  # -----------------------------------------------------------------------------
16
 
 
 
 
 
17
  # HuggingFace core
18
  transformers==5.5.0
19
  datasets==4.8.4
20
  accelerate==1.13.0
 
21
  huggingface-hub==1.9.0
22
 
 
 
 
23
  # Audio processing
24
  librosa==0.10.2
25
  soundfile==0.12.1
 
 
 
 
26
 
27
+ # Metrics (used in app.py CER display)
28
  jiwer==3.0.4
29
 
30
  # Config & environment
 
37
  # Pydantic v2
38
  pydantic==2.11.3
39
 
 
 
 
 
40
  # Utilities
41
  numpy==2.2.4
42
  scipy==1.15.2
 
 
43
  rapidfuzz==3.13.0
44
 
 
 
 
 
 
45
  # Kaggle API (used by Self-Teaching tab to trigger training runs)
46
  kaggle>=1.6.0