batchalign 0.8.1.post3__tar.gz → 0.8.1.post4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of batchalign might be problematic. Click here for more details.
- {batchalign-0.8.1.post3/batchalign.egg-info → batchalign-0.8.1.post4}/PKG-INFO +4 -1
- batchalign-0.8.1.post4/batchalign/__main__.py +4 -0
- batchalign-0.8.1.post4/batchalign/cli/bench.py +48 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/cli/cli.py +22 -2
- batchalign-0.8.1.post4/batchalign/cli/dispatch.py +1044 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/document.py +10 -10
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/chat/file.py +1 -1
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/chat/generator.py +8 -9
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/chat/parser.py +28 -11
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/chat/utils.py +5 -4
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/textgrid/parser.py +3 -3
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/resolve.py +8 -3
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/speaker/infer.py +5 -2
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/training/utils.py +5 -5
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/utils.py +71 -7
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/utterance/cantonese_infer.py +2 -2
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/utterance/prep.py +4 -4
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/wave2vec/infer_fa.py +22 -11
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/whisper/infer_asr.py +36 -15
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/whisper/infer_fa.py +22 -12
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/analysis/eval.py +2 -2
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2chinese.py +1 -1
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/oai_whisper.py +1 -2
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/rev.py +22 -17
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/utils.py +9 -7
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/whisper.py +2 -3
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/whisperx.py +59 -13
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/base.py +5 -2
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/cleanup/parse_support.py +17 -15
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/diarization/pyannote.py +2 -2
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/dispatch.py +37 -32
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/fa/wave2vec_fa.py +1 -1
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/fa/whisper_fa.py +25 -16
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/morphosyntax/en/irr.py +2 -2
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/morphosyntax/ud.py +88 -57
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/opensmile/engine.py +2 -2
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/speaker/nemo_speaker.py +1 -1
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/utr/rev_utr.py +6 -7
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/utr/whisper_utr.py +0 -1
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/utterance/ud_utterance.py +32 -28
- batchalign-0.8.1.post4/batchalign/tests/cli/test_dispatch_memory.py +290 -0
- batchalign-0.8.1.post4/batchalign/tests/models/test_audio_lazy.py +44 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/pipelines/analysis/test_eval.py +1 -1
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/pipelines/asr/test_asr_pipeline.py +21 -4
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/pipelines/test_pipeline.py +3 -3
- batchalign-0.8.1.post4/batchalign/utils/device.py +9 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/utils/dp.py +3 -4
- batchalign-0.8.1.post4/batchalign/version +3 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4/batchalign.egg-info}/PKG-INFO +4 -1
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign.egg-info/SOURCES.txt +4 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign.egg-info/requires.txt +3 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/setup.py +3 -0
- batchalign-0.8.1.post3/batchalign/__main__.py +0 -4
- batchalign-0.8.1.post3/batchalign/cli/dispatch.py +0 -663
- batchalign-0.8.1.post3/batchalign/version +0 -3
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/LICENSE +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/MANIFEST.in +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/README.md +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/cli/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/cli/cache.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/constants.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/errors.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/base.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/chat/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/chat/lexer.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/textgrid/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/textgrid/file.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/formats/textgrid/generator.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/speaker/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/speaker/config.yaml +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/speaker/utils.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/training/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/training/run.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/utterance/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/utterance/dataset.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/utterance/execute.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/utterance/infer.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/utterance/train.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/wave2vec/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/models/whisper/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/analysis/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/deu.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/ell.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/eng.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/eus.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/fra.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/hrv.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/ind.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/jpn.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/nld.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/por.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/spa.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/asr/num2lang/tha.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/avqi/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/avqi/engine.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/cache.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/cleanup/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/cleanup/cleanup.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/cleanup/disfluencies.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/cleanup/retrace.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/cleanup/support/filled_pauses.eng +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/cleanup/support/replacements.eng +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/cleanup/support/test.test +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/diarization/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/fa/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/morphosyntax/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/morphosyntax/coref.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/morphosyntax/fr/apm.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/morphosyntax/fr/apmn.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/morphosyntax/fr/case.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/morphosyntax/ja/verbforms.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/opensmile/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/pipeline.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/speaker/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/translate/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/translate/gtrans.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/translate/seamless.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/translate/utils.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/utr/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/utr/utils.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/pipelines/utterance/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/conftest.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/formats/chat/test_chat_file.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/formats/chat/test_chat_generator.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/formats/chat/test_chat_lexer.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/formats/chat/test_chat_parser.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/formats/chat/test_chat_utils.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/formats/textgrid/test_textgrid.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/pipelines/asr/test_asr_utils.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/pipelines/cache/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/pipelines/cache/test_cache.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/pipelines/cleanup/test_disfluency.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/pipelines/cleanup/test_parse_support.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/pipelines/fa/test_fa_pipeline.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/pipelines/fixures.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/pipelines/test_pipeline_models.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/tests/test_document.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/utils/__init__.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/utils/abbrev.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/utils/compounds.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/utils/config.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/utils/names.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign/utils/utils.py +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign.egg-info/dependency_links.txt +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign.egg-info/entry_points.txt +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/batchalign.egg-info/top_level.txt +0 -0
- {batchalign-0.8.1.post3 → batchalign-0.8.1.post4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: batchalign
|
|
3
|
-
Version: 0.8.1.
|
|
3
|
+
Version: 0.8.1.post4
|
|
4
4
|
Summary: Python Speech Language Sample Analysis
|
|
5
5
|
Author: Brian MacWhinney, Houjun Liu
|
|
6
6
|
Author-email: macw@cmu.edu, houjun@cmu.edu
|
|
@@ -48,6 +48,9 @@ Requires-Dist: onnxruntime
|
|
|
48
48
|
Requires-Dist: certifi>=2025.10.5
|
|
49
49
|
Provides-Extra: dev
|
|
50
50
|
Requires-Dist: pytest; extra == "dev"
|
|
51
|
+
Requires-Dist: mypy; extra == "dev"
|
|
52
|
+
Requires-Dist: pyrefly; extra == "dev"
|
|
53
|
+
Requires-Dist: ty; extra == "dev"
|
|
51
54
|
Provides-Extra: train
|
|
52
55
|
Requires-Dist: accelerate~=0.27; extra == "train"
|
|
53
56
|
Provides-Extra: docs
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import time
|
|
2
|
+
import os
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
import rich_click as click
|
|
6
|
+
from rich.console import Console
|
|
7
|
+
|
|
8
|
+
from batchalign.cli.dispatch import _dispatch
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@click.command()
|
|
12
|
+
@click.argument("command", type=click.Choice(["align", "transcribe", "transcribe_s", "morphotag", "translate", "utseg", "benchmark", "opensmile", "coref"]))
|
|
13
|
+
@click.argument("in_dir", type=click.Path(exists=True, file_okay=False))
|
|
14
|
+
@click.argument("out_dir", type=click.Path(exists=True, file_okay=False))
|
|
15
|
+
@click.option("--runs", type=int, default=1, show_default=True, help="Number of benchmark runs.")
|
|
16
|
+
@click.option("--no-pool", is_flag=True, default=False, help="Disable pooled execution for this benchmark run.")
|
|
17
|
+
@click.option("--no-lazy-audio", is_flag=True, default=False, help="Disable lazy audio loading for this benchmark run.")
|
|
18
|
+
@click.option("--no-adaptive-workers", is_flag=True, default=False, help="Disable adaptive worker caps for this benchmark run.")
|
|
19
|
+
@click.option("--workers", type=int, default=None, help="Number of workers to use (defaults to CPU count).")
|
|
20
|
+
@click.pass_context
|
|
21
|
+
def bench(ctx, command, in_dir, out_dir, runs, no_pool, no_lazy_audio, no_adaptive_workers, workers):
|
|
22
|
+
"""Benchmark Batchalign command performance on a dataset."""
|
|
23
|
+
console = Console()
|
|
24
|
+
durations = []
|
|
25
|
+
for idx in range(runs):
|
|
26
|
+
run_ctx = type("Ctx", (), {"obj": dict(ctx.obj)})()
|
|
27
|
+
if no_pool:
|
|
28
|
+
run_ctx.obj["pool"] = False
|
|
29
|
+
if no_lazy_audio:
|
|
30
|
+
run_ctx.obj["lazy_audio"] = False
|
|
31
|
+
if no_adaptive_workers:
|
|
32
|
+
run_ctx.obj["adaptive_workers"] = False
|
|
33
|
+
if workers is not None:
|
|
34
|
+
run_ctx.obj["workers"] = workers
|
|
35
|
+
start = time.time()
|
|
36
|
+
if command in ["align", "morphotag", "translate", "utseg", "coref"]:
|
|
37
|
+
extensions = ["cha"]
|
|
38
|
+
elif command in ["transcribe", "transcribe_s", "benchmark", "opensmile"]:
|
|
39
|
+
extensions = ["wav", "mp3", "mp4"]
|
|
40
|
+
else:
|
|
41
|
+
extensions = ["cha"]
|
|
42
|
+
_dispatch(command, "eng", 1, extensions, run_ctx,
|
|
43
|
+
in_dir, out_dir, None, None, console)
|
|
44
|
+
durations.append(time.time() - start)
|
|
45
|
+
console.print(f"[dim]Run {idx+1}/{runs}:[/dim] {durations[-1]:.2f}s")
|
|
46
|
+
if durations:
|
|
47
|
+
avg = sum(durations) / len(durations)
|
|
48
|
+
console.print(f"\n[bold]Average:[/bold] {avg:.2f}s over {len(durations)} run(s)")
|
|
@@ -16,6 +16,7 @@ from rich.console import Console
|
|
|
16
16
|
from rich.logging import RichHandler
|
|
17
17
|
|
|
18
18
|
from batchalign.cli.dispatch import _dispatch
|
|
19
|
+
from batchalign.cli.bench import bench
|
|
19
20
|
from batchalign.models.training.run import cli as train
|
|
20
21
|
|
|
21
22
|
import pyfiglet
|
|
@@ -68,8 +69,17 @@ def handle_verbosity(verbosity):
|
|
|
68
69
|
@click.pass_context
|
|
69
70
|
@click.version_option(VERSION_NUMBER)
|
|
70
71
|
@click.option("-v", "--verbose", type=int, count=True, default=0, help="How loquacious Batchalign should be.")
|
|
71
|
-
@click.option("--workers", type=int, default=os.cpu_count(), help="Number of
|
|
72
|
-
|
|
72
|
+
@click.option("--workers", type=int, default=os.cpu_count(), help="Number of workers (threads when pooled, processes otherwise).")
|
|
73
|
+
@click.option("--memlog", is_flag=True, default=False, help="Write memory telemetry log to OUT_DIR.")
|
|
74
|
+
@click.option("--mem-guard", is_flag=True, default=False, help="Abort early if available memory is too low to start a new worker.")
|
|
75
|
+
@click.option("--adaptive-workers/--no-adaptive-workers", default=True, help="Adaptively cap workers based on observed memory.")
|
|
76
|
+
@click.option("--pool/--no-pool", default=True, help="Allow pooled model execution for multi-file runs.")
|
|
77
|
+
@click.option("--lazy-audio/--no-lazy-audio", default=True, help="Enable lazy audio loading for alignment/ASR.")
|
|
78
|
+
@click.option("--adaptive-safety-factor", type=float, default=1.35, show_default=True, help="Safety factor applied to observed worker RSS peaks.")
|
|
79
|
+
@click.option("--adaptive-warmup", type=int, default=2, show_default=True, help="Initial worker count before adaptive cap kicks in.")
|
|
80
|
+
@click.option("--force-cpu/--no-force-cpu", default=False, help="Disable MPS/CUDA and force CPU-only models.")
|
|
81
|
+
@click.option("--shared-models/--no-shared-models", default=False, help="Preload models and fork workers to share read-only memory (advanced; ignored in pooled mode).")
|
|
82
|
+
def batchalign(ctx, verbose, workers, memlog, mem_guard, adaptive_workers, adaptive_safety_factor, adaptive_warmup, pool, lazy_audio, force_cpu, shared_models):
|
|
73
83
|
"""process .cha and/or audio files in IN_DIR and dumps them to OUT_DIR using recipe COMMAND"""
|
|
74
84
|
|
|
75
85
|
## setup commands ##
|
|
@@ -82,6 +92,15 @@ def batchalign(ctx, verbose, workers):
|
|
|
82
92
|
# add to arguments
|
|
83
93
|
ctx.obj["verbose"] = verbose
|
|
84
94
|
ctx.obj["workers"] = workers
|
|
95
|
+
ctx.obj["memlog"] = memlog
|
|
96
|
+
ctx.obj["mem_guard"] = mem_guard
|
|
97
|
+
ctx.obj["adaptive_workers"] = adaptive_workers
|
|
98
|
+
ctx.obj["adaptive_safety_factor"] = adaptive_safety_factor
|
|
99
|
+
ctx.obj["adaptive_warmup"] = adaptive_warmup
|
|
100
|
+
ctx.obj["pool"] = pool
|
|
101
|
+
ctx.obj["lazy_audio"] = lazy_audio
|
|
102
|
+
ctx.obj["force_cpu"] = force_cpu
|
|
103
|
+
ctx.obj["shared_models"] = shared_models
|
|
85
104
|
# setup config
|
|
86
105
|
from batchalign.utils import config
|
|
87
106
|
ctx.obj["config"] = config.config_read(True)
|
|
@@ -91,6 +110,7 @@ def batchalign(ctx, verbose, workers):
|
|
|
91
110
|
install()
|
|
92
111
|
|
|
93
112
|
batchalign.add_command(train, "models")
|
|
113
|
+
batchalign.add_command(bench, "bench")
|
|
94
114
|
|
|
95
115
|
from batchalign.cli.cache import cache
|
|
96
116
|
batchalign.add_command(cache, "cache")
|