-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
69 lines (59 loc) · 2.61 KB
/
Copy pathpyproject.toml
File metadata and controls
69 lines (59 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
[project]
name = "live-subtitles"
version = "0.1.0"
description = "Browser-based live captioning: EN/FR speech -> transcription -> translation. Server-side, swappable ASR."
requires-python = ">=3.11,<3.13"
dependencies = ["soxr>=1.1.0,<2", "transformers>=5.9.0,<6", "sentencepiece>=0.2.1,<0.3", "sacremoses>=0.1.1,<0.2"]
# --- pixi (local dev environment manager) ---
# Deploy target is HF Spaces free CPU (linux-64); osx-arm64 is the dev machine.
# faster-whisper / CTranslate2 is CPU-only on both, so dev and deploy latency are comparable.
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64"]
[tool.pixi.dependencies]
python = "3.12.*"
# PyAV from conda-forge (prebuilt) so it isn't compiled against the system ffmpeg,
# which fails on Homebrew ffmpeg 7. pixi maps it to satisfy the PyPI solve.
# Capped to the same range used by faster-whisper's audio stack on deploy.
av = ">=14,<17"
# Mic capture (slice 1b). conda-forge ships PortAudio prebuilt with the bindings.
python-sounddevice = "*"
# numpy/pillow are capped to match the deploy requirements and avoid surprise major
# upgrades in the Gradio/faster-whisper stack.
numpy = "<2.2"
pillow = "<12"
[tool.pixi.pypi-dependencies]
# faster-whisper + ctranslate2 ship prebuilt PyPI wheels (no compile); av is satisfied above.
faster-whisper = "*"
# WER metric for compare.py (step 3). Pure-python + rapidfuzz (prebuilt wheels).
jiwer = "*"
gradio = ">=5.50,<6"
[tool.pixi.tasks]
# Throwaway vertical-slice tasks (build-order step 1) — remove once the real pipeline lands.
slice-1a = "python slice_1a.py"
slice-1b = "python slice_1b.py"
slice-2 = "python slice_2.py"
compare = "python compare.py"
# The Gradio app.
app = "python -m src.app"
# Test feature for the deterministic core (step 5): audio.py + captions.py.
[tool.pixi.feature.test.dependencies]
pytest = "*"
[tool.pixi.feature.test.tasks]
test = "pytest"
# Make `import src.audio` work without installing the project as a package.
[tool.pytest.ini_options]
pythonpath = ["."]
testpaths = ["tests"]
# torch is needed ONLY to convert Opus-MT weights to CTranslate2 format (build time).
# It lives in its own `convert` env so the default/deploy env stays torch-free.
[dependency-groups]
convert = ["torch"]
[tool.pixi.feature.convert.tasks]
# One-time: convert the configured Opus-MT directions into models/ (CTranslate2 int8).
convert-mt = "python convert_opus_mt.py"
[tool.pixi.environments]
default = { solve-group = "default" }
test = { features = ["test"], solve-group = "default" }
# Separate solve so torch (and its large transitive set) never enters the deploy lock.
convert = { features = ["convert"] }