python-voiceio 1.18.7__tar.gz → 1.18.9__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.
- {python_voiceio-1.18.7/python_voiceio.egg-info → python_voiceio-1.18.9}/PKG-INFO +3 -3
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/README.md +1 -1
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/pyproject.toml +2 -2
- {python_voiceio-1.18.7 → python_voiceio-1.18.9/python_voiceio.egg-info}/PKG-INFO +3 -3
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/python_voiceio.egg-info/SOURCES.txt +1 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/python_voiceio.egg-info/requires.txt +1 -1
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_learn_pipeline.py +58 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_learn_summary.py +100 -5
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_sherpa.py +92 -1
- python_voiceio-1.18.9/voiceio/__init__.py +1 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/cli/learn.py +12 -1
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/cli/models.py +21 -12
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/decoders/__init__.py +1 -2
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/decoders/fetch.py +33 -19
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/decoders/sherpa.py +37 -13
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/health.py +5 -3
- python_voiceio-1.18.9/voiceio/learn/lastrun.py +86 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/summary.py +23 -10
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/service.py +50 -16
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/telemetry.py +5 -4
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tts/supertonic_engine.py +1 -1
- python_voiceio-1.18.7/voiceio/__init__.py +0 -1
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/LICENSE +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/python_voiceio.egg-info/dependency_links.txt +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/python_voiceio.egg-info/entry_points.txt +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/python_voiceio.egg-info/top_level.txt +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/setup.cfg +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_announce.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_app_wiring.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_audio_quality.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_audio_source.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_backend_probes.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_cancel.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_cli.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_clipboard_read.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_clipboard_typer.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_commands.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_concurrency_lockdown.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_config.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_context_terms.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_corrections.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_cuda_setup_hint.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_dead_mic.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_decoders.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_engine.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_errorlog.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_evdev_uaccess.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_evdev_x11_optional.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_fallback.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_fcitx_bridge.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_feedback_stream.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_focus.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_gpu_fallback.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_health.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_hints.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_history.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_hotkey_modes.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_ibus_engine_limits.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_ibus_engine_listener.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_ibus_pending.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_ibus_pids.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_ibus_ping.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_ibus_session.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_ibus_textlimit.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_ibus_typer.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_idle_audio.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_install_env.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_learn_clean.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_learn_import.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_learn_language.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_learn_metrics.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_learn_quiet.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_learn_resume.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_learn_review.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_learn_targets.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_llm.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_llm_api.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_mic_gain.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_modifier_guard.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_numbers.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_paste_last.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_pipeline.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_platform.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_postcorrect.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_postprocess.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_prebuffer.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_presence.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_prompt.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_quiet_audio.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_recorder_integration.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_replies.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_report.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_retention.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_robustness.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_security_hardening.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_server.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_service.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_setup.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_spool.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_streaming.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_suggest.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_telemetry.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_tokens.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_transcriber.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_tray.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_tts.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_typer_manager.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_vad.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_vocabulary.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_wordfreq.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/tests/test_worker_decode.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/__main__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/announce.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/app.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/audio_source.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/backends.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/cli/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/cli/configcmd.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/cli/corrections.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/cli/doctor.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/cli/history.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/cli/replies.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/cli/servicecmd.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/cli/uninstall.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/cli/vocab.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/clipboard_read.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/commands.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/config.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/consent.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/context_terms.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/bias.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/decoders/base.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/decoders/catalog.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/decoders/faster_whisper/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/decoders/faster_whisper/worker.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/decoders/lanes.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/decoders/whispercpp.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/engine.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/core/pipeline.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/corrections.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/data/60-voiceio-uaccess.rules +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/data/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/demo.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/display.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/errorlog.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/feedback.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/focus.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/hints.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/history.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/hotkeys/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/hotkeys/base.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/hotkeys/chain.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/hotkeys/evdev.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/hotkeys/pynput_backend.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/hotkeys/socket_backend.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/ibus/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/ibus/engine.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/ibus/install.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/ibus/pending.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/ibus/session.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/ibus/textlimit.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/idle_audio.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/install_env.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/augment.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/clean.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/evaluate.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/importer.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/metrics.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/quiet.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/review.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/store.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/teacher.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/learn/train.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/llm.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/llm_api.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/mic_gain.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/models/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/models/silero_vad.onnx +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/numbers.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/pidlock.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/platform.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/postcorrect.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/postprocess.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/power.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/presence.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/privacy.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/prompt.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/quiet_audio.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/recorder.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/replies.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/report.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/retention.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/server/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/server/__main__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/server/app.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/server/config.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/server/runtime.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/setup/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/setup/configfile.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/setup/extras.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/setup/hotkey.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/setup/noninteractive.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/setup/speech.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/setup/steps.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/setup/system.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/setup/ui.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/sounds/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/sounds/alert.wav +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/sounds/commit.wav +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/sounds/start.wav +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/sounds/stop.wav +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/spool.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/streaming.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/suggest.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tokens.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tray/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tray/_icons.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tray/_indicator.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tray/_pystray.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tts/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tts/base.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tts/chain.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tts/edge_engine.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tts/espeak.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tts/piper_engine.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/tts/player.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/__init__.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/base.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/chain.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/clipboard.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/collecting.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/fcitx_bridge.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/ibus.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/manager.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/modifier_guard.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/paste.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/pynput_type.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/wtype.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/xdotool.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/typers/ydotool.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/ui.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/vad.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/vocab_stats.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/vocabulary.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/watchdog.py +0 -0
- {python_voiceio-1.18.7 → python_voiceio-1.18.9}/voiceio/wordfreq.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-voiceio
|
|
3
|
-
Version: 1.18.
|
|
3
|
+
Version: 1.18.9
|
|
4
4
|
Summary: Voice dictation for Linux. Speak → text, locally, instantly.
|
|
5
5
|
Author: Hugo Montenegro
|
|
6
6
|
License-Expression: MIT
|
|
@@ -44,7 +44,7 @@ Requires-Dist: torch>=2.2; extra == "train"
|
|
|
44
44
|
Requires-Dist: transformers>=4.40; extra == "train"
|
|
45
45
|
Requires-Dist: peft>=0.10; extra == "train"
|
|
46
46
|
Provides-Extra: sherpa
|
|
47
|
-
Requires-Dist: sherpa-onnx>=
|
|
47
|
+
Requires-Dist: sherpa-onnx>=2.0.2; extra == "sherpa"
|
|
48
48
|
Provides-Extra: dev
|
|
49
49
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
50
50
|
Requires-Dist: pytest-mock; extra == "dev"
|
|
@@ -139,7 +139,7 @@ Everything lives in `~/.config/voiceio/config.toml`; [config.example.toml](confi
|
|
|
139
139
|
|
|
140
140
|
## Roadmap
|
|
141
141
|
|
|
142
|
-
- **Parakeet by default for everyone**:
|
|
142
|
+
- **Parakeet by default for everyone**: our sherpa-onnx fixes ([#4084](https://github.com/k2-fsa/sherpa-onnx/pull/4084), [#4088](https://github.com/k2-fsa/sherpa-onnx/pull/4088)) are released in sherpa-onnx 2.0.2, so `pip install 'python-voiceio[sherpa]'` makes Parakeet the default ([why](CONTRIBUTING.md#model-choice-parakeet-where-it-can-be-biased-whisper-otherwise)).
|
|
143
143
|
- **GPU on AMD and Intel**: let setup run a Vulkan whisper.cpp server for you.
|
|
144
144
|
- **Typing without IBus on GNOME and KDE**: a libei backend.
|
|
145
145
|
- **Distro packages**: AUR (packaged, not yet published) and .rpm.
|
|
@@ -86,7 +86,7 @@ Everything lives in `~/.config/voiceio/config.toml`; [config.example.toml](confi
|
|
|
86
86
|
|
|
87
87
|
## Roadmap
|
|
88
88
|
|
|
89
|
-
- **Parakeet by default for everyone**:
|
|
89
|
+
- **Parakeet by default for everyone**: our sherpa-onnx fixes ([#4084](https://github.com/k2-fsa/sherpa-onnx/pull/4084), [#4088](https://github.com/k2-fsa/sherpa-onnx/pull/4088)) are released in sherpa-onnx 2.0.2, so `pip install 'python-voiceio[sherpa]'` makes Parakeet the default ([why](CONTRIBUTING.md#model-choice-parakeet-where-it-can-be-biased-whisper-otherwise)).
|
|
90
90
|
- **GPU on AMD and Intel**: let setup run a Vulkan whisper.cpp server for you.
|
|
91
91
|
- **Typing without IBus on GNOME and KDE**: a libei backend.
|
|
92
92
|
- **Distro packages**: AUR (packaged, not yet published) and .rpm.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-voiceio"
|
|
7
|
-
version = "1.18.
|
|
7
|
+
version = "1.18.9"
|
|
8
8
|
description = "Voice dictation for Linux. Speak → text, locally, instantly."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -54,7 +54,7 @@ tts = ["piper-tts>=1.3.0", "edge-tts>=6.1.0"]
|
|
|
54
54
|
# `voiceio learn train`: LoRA fine-tuning (a GPU helps; see voiceio/learn/train.py)
|
|
55
55
|
train = ["torch>=2.2", "transformers>=4.40", "peft>=0.10"]
|
|
56
56
|
# Alternative decoder runtime (Parakeet & co.); see CONTRIBUTING.md "Model choice".
|
|
57
|
-
sherpa = ["sherpa-onnx>=
|
|
57
|
+
sherpa = ["sherpa-onnx>=2.0.2"]
|
|
58
58
|
dev = ["pytest>=7.0", "pytest-mock", "ruff>=0.15,<0.18"]
|
|
59
59
|
|
|
60
60
|
[project.urls]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-voiceio
|
|
3
|
-
Version: 1.18.
|
|
3
|
+
Version: 1.18.9
|
|
4
4
|
Summary: Voice dictation for Linux. Speak → text, locally, instantly.
|
|
5
5
|
Author: Hugo Montenegro
|
|
6
6
|
License-Expression: MIT
|
|
@@ -44,7 +44,7 @@ Requires-Dist: torch>=2.2; extra == "train"
|
|
|
44
44
|
Requires-Dist: transformers>=4.40; extra == "train"
|
|
45
45
|
Requires-Dist: peft>=0.10; extra == "train"
|
|
46
46
|
Provides-Extra: sherpa
|
|
47
|
-
Requires-Dist: sherpa-onnx>=
|
|
47
|
+
Requires-Dist: sherpa-onnx>=2.0.2; extra == "sherpa"
|
|
48
48
|
Provides-Extra: dev
|
|
49
49
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
50
50
|
Requires-Dist: pytest-mock; extra == "dev"
|
|
@@ -139,7 +139,7 @@ Everything lives in `~/.config/voiceio/config.toml`; [config.example.toml](confi
|
|
|
139
139
|
|
|
140
140
|
## Roadmap
|
|
141
141
|
|
|
142
|
-
- **Parakeet by default for everyone**:
|
|
142
|
+
- **Parakeet by default for everyone**: our sherpa-onnx fixes ([#4084](https://github.com/k2-fsa/sherpa-onnx/pull/4084), [#4088](https://github.com/k2-fsa/sherpa-onnx/pull/4088)) are released in sherpa-onnx 2.0.2, so `pip install 'python-voiceio[sherpa]'` makes Parakeet the default ([why](CONTRIBUTING.md#model-choice-parakeet-where-it-can-be-biased-whisper-otherwise)).
|
|
143
143
|
- **GPU on AMD and Intel**: let setup run a Vulkan whisper.cpp server for you.
|
|
144
144
|
- **Typing without IBus on GNOME and KDE**: a libei backend.
|
|
145
145
|
- **Distro packages**: AUR (packaged, not yet published) and .rpm.
|
|
@@ -511,3 +511,61 @@ def test_schedule_on_states_the_configured_threshold(monkeypatch, capsys):
|
|
|
511
511
|
monkeypatch.setattr(service, "learn_schedule_summary", lambda: "daily at 03:30")
|
|
512
512
|
cli.cmd_schedule(argparse.Namespace(state="on", at=None, every=None, auto_promote=False))
|
|
513
513
|
assert "retrains once 20+ clips are new" in capsys.readouterr().out
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
def test_maintain_records_the_run(monkeypatch):
|
|
517
|
+
"""`learn report` reads what the last run did from its own record."""
|
|
518
|
+
import argparse
|
|
519
|
+
|
|
520
|
+
from voiceio.cli import learn as cli
|
|
521
|
+
from voiceio.learn import lastrun
|
|
522
|
+
|
|
523
|
+
def label(a):
|
|
524
|
+
_clip("new.wav", 3, "x")
|
|
525
|
+
store.add_label("new.wav", [Segment(0, 3, "a new one")], "teacher:fake")
|
|
526
|
+
monkeypatch.setenv("INVOCATION_ID", "abc")
|
|
527
|
+
monkeypatch.setattr(cli, "cmd_label", label)
|
|
528
|
+
monkeypatch.setattr(cli, "_announce_learning", lambda min_new: None)
|
|
529
|
+
monkeypatch.setattr(train, "missing_train_deps", lambda: ["torch"])
|
|
530
|
+
cli.cmd_maintain(argparse.Namespace(min_new=5, base="small", epochs=1))
|
|
531
|
+
rec = lastrun.read()
|
|
532
|
+
assert rec["outcome"] == "labelled" and rec["labelled"] == 1 and rec["scheduled"] is True
|
|
533
|
+
assert rec["ended"] >= rec["started"]
|
|
534
|
+
|
|
535
|
+
monkeypatch.setattr(cli, "cmd_label", lambda a: None)
|
|
536
|
+
cli.cmd_maintain(argparse.Namespace(min_new=5, base="small", epochs=1))
|
|
537
|
+
assert lastrun.read()["outcome"] == "skipped"
|
|
538
|
+
|
|
539
|
+
def boom(a):
|
|
540
|
+
raise RuntimeError("teacher crashed")
|
|
541
|
+
monkeypatch.setattr(cli, "cmd_label", boom)
|
|
542
|
+
with pytest.raises(RuntimeError):
|
|
543
|
+
cli.cmd_maintain(argparse.Namespace(min_new=5, base="small", epochs=1))
|
|
544
|
+
assert lastrun.read()["outcome"] == "failed"
|
|
545
|
+
|
|
546
|
+
with pytest.raises(SystemExit): # a bad setting fails the run too
|
|
547
|
+
cli.cmd_maintain(argparse.Namespace(min_new=0, base="small", epochs=1))
|
|
548
|
+
assert lastrun.read()["outcome"] == "failed"
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
def test_maintain_records_a_retrain(monkeypatch):
|
|
552
|
+
import argparse
|
|
553
|
+
|
|
554
|
+
from voiceio.cli import learn as cli
|
|
555
|
+
from voiceio.learn import lastrun
|
|
556
|
+
_maintain_calls(monkeypatch)
|
|
557
|
+
cli.cmd_maintain(argparse.Namespace(min_new=1, base="small", epochs=1))
|
|
558
|
+
assert lastrun.read()["outcome"] == "retrained"
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
def test_when_idle_worker_leaves_the_record_to_its_parent(monkeypatch):
|
|
562
|
+
import argparse
|
|
563
|
+
|
|
564
|
+
from voiceio.cli import learn as cli
|
|
565
|
+
from voiceio.learn import lastrun, quiet
|
|
566
|
+
monkeypatch.setenv(quiet.WORKER_ENV, "1")
|
|
567
|
+
monkeypatch.setattr(cli, "cmd_label", lambda a: None)
|
|
568
|
+
monkeypatch.setattr(cli, "_announce_learning", lambda min_new: None)
|
|
569
|
+
monkeypatch.setattr(train, "missing_train_deps", lambda: ["torch"])
|
|
570
|
+
cli.cmd_maintain(argparse.Namespace(min_new=5, base="small", epochs=1, when_idle=True))
|
|
571
|
+
assert lastrun.read() is None
|
|
@@ -157,17 +157,112 @@ def test_cli_prints_json_and_text(seeded, capsys, monkeypatch):
|
|
|
157
157
|
assert "decoder errors" in text and "zorblax" not in text
|
|
158
158
|
|
|
159
159
|
|
|
160
|
-
def
|
|
160
|
+
def _systemctl(trigger: str, result: str = "success", *, unix_flag: bool = True):
|
|
161
|
+
"""A fake `systemctl show`: LastTriggerUSec prints `trigger`; without
|
|
162
|
+
`unix_flag` the --timestamp=unix flag is refused (systemd < 250)."""
|
|
161
163
|
import subprocess
|
|
164
|
+
calls = []
|
|
162
165
|
|
|
163
166
|
def fake(argv, **kw):
|
|
167
|
+
calls.append(argv)
|
|
168
|
+
if "--timestamp=unix" in argv and not unix_flag:
|
|
169
|
+
return subprocess.CompletedProcess(argv, 1, stdout="",
|
|
170
|
+
stderr="Unknown timestamp format: unix")
|
|
164
171
|
prop = argv[argv.index("-p") + 1]
|
|
165
|
-
out = {"LastTriggerUSec":
|
|
166
|
-
return subprocess.CompletedProcess(argv, 0, stdout=out)
|
|
172
|
+
out = {"LastTriggerUSec": trigger, "Result": result}[prop]
|
|
173
|
+
return subprocess.CompletedProcess(argv, 0, stdout=out + "\n")
|
|
174
|
+
return fake, calls
|
|
175
|
+
|
|
167
176
|
|
|
177
|
+
def test_learn_last_run_parses_systemctl(monkeypatch):
|
|
178
|
+
fake, _ = _systemctl("@1763260212")
|
|
168
179
|
monkeypatch.setattr(service.subprocess, "run", fake)
|
|
169
180
|
assert service.learn_last_run() == (1763260212.0, "success")
|
|
170
181
|
|
|
171
|
-
|
|
172
|
-
|
|
182
|
+
|
|
183
|
+
def test_learn_last_run_reads_the_local_time_form(monkeypatch):
|
|
184
|
+
"""systemd < 259 ignores --timestamp=unix for LastTriggerUSec and prints
|
|
185
|
+
the local-time form: the report said "never fired" for a timer that ran."""
|
|
186
|
+
when = NOW - 4 * DAY
|
|
187
|
+
shown = dt.datetime.fromtimestamp(when).strftime("%a %Y-%m-%d %H:%M:%S WET")
|
|
188
|
+
fake, _ = _systemctl(shown)
|
|
189
|
+
monkeypatch.setattr(service.subprocess, "run", fake)
|
|
190
|
+
assert service.learn_last_run() == (when, "success")
|
|
191
|
+
|
|
192
|
+
utc = dt.datetime.fromtimestamp(when, dt.timezone.utc).strftime("%a %Y-%m-%d %H:%M:%S UTC")
|
|
193
|
+
fake, _ = _systemctl(utc)
|
|
194
|
+
monkeypatch.setattr(service.subprocess, "run", fake)
|
|
195
|
+
assert service.learn_last_run() == (when, "success")
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def test_learn_last_run_without_the_unix_flag(monkeypatch):
|
|
199
|
+
"""systemd < 250 refuses --timestamp=unix: ask again without it."""
|
|
200
|
+
when = NOW - 4 * DAY
|
|
201
|
+
shown = dt.datetime.fromtimestamp(when).strftime("%a %Y-%m-%d %H:%M:%S CET")
|
|
202
|
+
fake, calls = _systemctl(shown, unix_flag=False)
|
|
203
|
+
monkeypatch.setattr(service.subprocess, "run", fake)
|
|
204
|
+
assert service.learn_last_run() == (when, "success")
|
|
205
|
+
assert not any("--timestamp=unix" in argv for argv in calls[1:])
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
@pytest.mark.parametrize("trigger", ["n/a", "", "@0", "0"])
|
|
209
|
+
def test_never_fired_has_no_result(monkeypatch, trigger):
|
|
210
|
+
"""A unit that never ran still says Result=success: that is not a result."""
|
|
211
|
+
fake, _ = _systemctl(trigger)
|
|
212
|
+
monkeypatch.setattr(service.subprocess, "run", fake)
|
|
173
213
|
assert service.learn_last_run() == (None, "")
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def _learning_report(monkeypatch, last_run, tmp_path) -> dict:
|
|
217
|
+
monkeypatch.setattr(service, "has_systemd", lambda: True)
|
|
218
|
+
monkeypatch.setattr(service, "learn_timer_enabled", lambda: True)
|
|
219
|
+
monkeypatch.setattr(service, "learning_now", lambda: False)
|
|
220
|
+
monkeypatch.setattr(service, "learn_last_run", last_run)
|
|
221
|
+
return summary.build(NOW, config.Config(), log_paths=[tmp_path / "missing.log"])
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def test_report_never_ran_has_a_null_result(monkeypatch, tmp_path):
|
|
225
|
+
out = _learning_report(monkeypatch, lambda: (None, ""), tmp_path)
|
|
226
|
+
assert out["learn_scheduled"] is True and out["learn_ran_7d"] is False
|
|
227
|
+
assert out["learn_last_run"] is None and out["learn_last_result"] is None
|
|
228
|
+
assert out["unavailable"]["learn_last_result"]
|
|
229
|
+
assert "never fired" in out["unavailable"]["learn_last_run"]
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def test_report_ran_four_days_ago(monkeypatch, tmp_path):
|
|
233
|
+
when = NOW - 4 * DAY
|
|
234
|
+
out = _learning_report(monkeypatch, lambda: (when, "success"), tmp_path)
|
|
235
|
+
assert out["learn_ran_7d"] is True
|
|
236
|
+
assert out["learn_last_run"] == dt.date.fromtimestamp(when).isoformat()
|
|
237
|
+
assert out["learn_last_result"] == "success"
|
|
238
|
+
assert "learn_last_run" not in out["unavailable"]
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def test_report_prefers_the_runs_own_record(monkeypatch, tmp_path):
|
|
242
|
+
from voiceio.learn import lastrun
|
|
243
|
+
when = NOW - 4 * DAY
|
|
244
|
+
lastrun.path().parent.mkdir(parents=True, exist_ok=True)
|
|
245
|
+
lastrun.path().write_text(json.dumps({"started": when, "ended": when + 5224,
|
|
246
|
+
"outcome": "labelled", "labelled": 724,
|
|
247
|
+
"scheduled": True}))
|
|
248
|
+
out = _learning_report(monkeypatch, lambda: pytest.fail("systemd not asked"), tmp_path)
|
|
249
|
+
assert out["learn_ran_7d"] is True
|
|
250
|
+
assert out["learn_last_run"] == dt.date.fromtimestamp(when).isoformat()
|
|
251
|
+
assert out["learn_last_result"] == "labelled"
|
|
252
|
+
|
|
253
|
+
# Killed before it could record an outcome (and not running now).
|
|
254
|
+
lastrun.path().write_text(json.dumps({"started": NOW - 9 * DAY, "ended": None,
|
|
255
|
+
"outcome": "running", "scheduled": True}))
|
|
256
|
+
out = _learning_report(monkeypatch, lambda: pytest.fail("systemd not asked"), tmp_path)
|
|
257
|
+
assert out["learn_ran_7d"] is False and out["learn_last_result"] == "unfinished"
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def test_report_record_without_systemd(monkeypatch, tmp_path):
|
|
261
|
+
from voiceio.learn import lastrun
|
|
262
|
+
lastrun.path().parent.mkdir(parents=True, exist_ok=True)
|
|
263
|
+
lastrun.path().write_text(json.dumps({"started": NOW - DAY, "ended": NOW - DAY + 60,
|
|
264
|
+
"outcome": "skipped", "labelled": 0}))
|
|
265
|
+
monkeypatch.setattr(service, "has_systemd", lambda: False)
|
|
266
|
+
out = summary.build(NOW, config.Config(), log_paths=[tmp_path / "missing.log"])
|
|
267
|
+
assert out["learn_scheduled"] is None and out["unavailable"]["learn_scheduled"]
|
|
268
|
+
assert out["learn_ran_7d"] is True and out["learn_last_result"] == "skipped"
|
|
@@ -18,7 +18,13 @@ from voiceio.core.decoders import BiasMode, build_decoder, catalog, fetch, sherp
|
|
|
18
18
|
from voiceio.core.decoders.base import Bias, DecodeError
|
|
19
19
|
from voiceio.core.decoders.sherpa import SherpaFeatures, SherpaTransducer, Tokenizer
|
|
20
20
|
|
|
21
|
+
# conftest replaces `sherpa.features` in every test; keep the real one.
|
|
22
|
+
REAL_FEATURES = sherpa.features
|
|
23
|
+
|
|
24
|
+
# Upstream sherpa-onnx >= 2.0.2: both fixes, length_reward only per stream.
|
|
21
25
|
FIXED = SherpaFeatures(installed=True, length_reward=True, pretokenized_hotwords=True)
|
|
26
|
+
# voiceio's old patched build: from_transducer(length_reward=…) as well.
|
|
27
|
+
PATCHED = SherpaFeatures(True, True, True, length_reward_kwarg=True)
|
|
22
28
|
TOKENS = "\n".join(f"{p} {i}" for i, p in enumerate(
|
|
23
29
|
["<unk>", "▁K", "al", "▁Kal", "sh", "hi", "shi", "▁", "K", "a", "l", "s", "h", "i",
|
|
24
30
|
"▁H", "▁Hy", "per", "p", "e", "r", "y", "H", "▁k", "k", "er"])) + "\n"
|
|
@@ -110,7 +116,8 @@ def test_one_recognizer_and_per_stream_pretokenized_proper_nouns(fake, tmp_path)
|
|
|
110
116
|
assert dec.name == "sherpa:parakeet-tdt-0.6b-v2"
|
|
111
117
|
kw = fake.created[0]
|
|
112
118
|
assert kw["decoding_method"] == "modified_beam_search"
|
|
113
|
-
assert (kw["
|
|
119
|
+
assert (kw["max_active_paths"], kw["hotwords_score"]) == (4, 2.0)
|
|
120
|
+
assert "length_reward" not in kw, "upstream from_transducer has no such kwarg"
|
|
114
121
|
assert "hotwords_file" not in kw and kw["modeling_unit"] == "bpe"
|
|
115
122
|
assert (tmp_path / "bpe.vocab").exists()
|
|
116
123
|
|
|
@@ -125,6 +132,90 @@ def test_one_recognizer_and_per_stream_pretokenized_proper_nouns(fake, tmp_path)
|
|
|
125
132
|
assert len(fake.created) == 1, "a new hotword set must never reload the model"
|
|
126
133
|
|
|
127
134
|
|
|
135
|
+
def test_patched_build_also_gets_length_reward_at_load(fake, monkeypatch, tmp_path):
|
|
136
|
+
monkeypatch.setattr(sherpa, "features", lambda: PATCHED)
|
|
137
|
+
dec = SherpaTransducer(_model_dir(tmp_path))
|
|
138
|
+
assert fake.created[0]["length_reward"] == 0.5
|
|
139
|
+
dec.decode(_audio(1), bias=Bias(hotwords="Kalshi"))
|
|
140
|
+
assert fake.streams[-1]["length_reward"] == "0.5"
|
|
141
|
+
assert fake.streams[-1]["hotwords"] == "▁Kal shi"
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def _sherpa_module(version, *, config_attr=False, pretokenized_flag=False):
|
|
145
|
+
"""A sherpa_onnx module shaped like a given release (set_option on the
|
|
146
|
+
stream in every one, as 2.0.1 already has it)."""
|
|
147
|
+
class OfflineRecognizerConfig:
|
|
148
|
+
pass
|
|
149
|
+
if config_attr:
|
|
150
|
+
OfflineRecognizerConfig.length_reward = 0.0
|
|
151
|
+
|
|
152
|
+
class OfflineRecognizer:
|
|
153
|
+
@staticmethod
|
|
154
|
+
def from_transducer(encoder, decoder, joiner, tokens, num_threads=1,
|
|
155
|
+
decoding_method="greedy_search", max_active_paths=4):
|
|
156
|
+
raise AssertionError("not called")
|
|
157
|
+
|
|
158
|
+
mod = types.SimpleNamespace(OfflineRecognizer=OfflineRecognizer,
|
|
159
|
+
OfflineRecognizerConfig=OfflineRecognizerConfig,
|
|
160
|
+
OfflineStream=type("OfflineStream", (), {"set_option": None}))
|
|
161
|
+
if version is not None:
|
|
162
|
+
mod.__version__ = version
|
|
163
|
+
if pretokenized_flag:
|
|
164
|
+
mod.HOTWORDS_PRETOKENIZED = True
|
|
165
|
+
return mod
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
@pytest.mark.parametrize("module, expected", [
|
|
169
|
+
(_sherpa_module("2.0.2"), SherpaFeatures(True, True, True, False)),
|
|
170
|
+
(_sherpa_module("2.0.10"), SherpaFeatures(True, True, True, False)),
|
|
171
|
+
(_sherpa_module("2.1.0.dev20261201+cuda"), SherpaFeatures(True, True, True, False)),
|
|
172
|
+
(_sherpa_module("3.0"), SherpaFeatures(True, True, True, False)),
|
|
173
|
+
(_sherpa_module("2.0.1"), SherpaFeatures(True, False, False, False)),
|
|
174
|
+
(_sherpa_module("1.13.8"), SherpaFeatures(True, False, False, False)),
|
|
175
|
+
(_sherpa_module("2.0.1+cuda12"), SherpaFeatures(True, False, False, False)),
|
|
176
|
+
(_sherpa_module(None), SherpaFeatures(True, False, False, False)),
|
|
177
|
+
(_sherpa_module("weird"), SherpaFeatures(True, False, False, False)),
|
|
178
|
+
# voiceio's patched wheels (built off 1.13.x/2.0.x).
|
|
179
|
+
(_sherpa_module("1.13.4", config_attr=True, pretokenized_flag=True),
|
|
180
|
+
SherpaFeatures(True, True, True, True)),
|
|
181
|
+
(_sherpa_module("2.0.1", config_attr=True), SherpaFeatures(True, True, False, True)),
|
|
182
|
+
], ids=["2.0.2", "2.0.10", "2.1-dev", "3.0", "2.0.1", "1.13.8", "2.0.1-local", "no-version",
|
|
183
|
+
"junk-version", "patched", "patched-no-pretok"])
|
|
184
|
+
def test_features_detects_upstream_by_version_and_patched_builds_by_signal(
|
|
185
|
+
monkeypatch, module, expected):
|
|
186
|
+
monkeypatch.setitem(sys.modules, "sherpa_onnx", module)
|
|
187
|
+
REAL_FEATURES.cache_clear()
|
|
188
|
+
try:
|
|
189
|
+
assert REAL_FEATURES() == expected
|
|
190
|
+
finally:
|
|
191
|
+
REAL_FEATURES.cache_clear()
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def test_features_patched_kwarg_found_by_signature(monkeypatch):
|
|
195
|
+
mod = _sherpa_module("2.0.1")
|
|
196
|
+
|
|
197
|
+
class OfflineRecognizer:
|
|
198
|
+
@staticmethod
|
|
199
|
+
def from_transducer(encoder, length_reward=0.0):
|
|
200
|
+
pass
|
|
201
|
+
mod.OfflineRecognizer = OfflineRecognizer
|
|
202
|
+
monkeypatch.setitem(sys.modules, "sherpa_onnx", mod)
|
|
203
|
+
REAL_FEATURES.cache_clear()
|
|
204
|
+
try:
|
|
205
|
+
assert REAL_FEATURES() == SherpaFeatures(True, True, False, True)
|
|
206
|
+
finally:
|
|
207
|
+
REAL_FEATURES.cache_clear()
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def test_features_without_sherpa(monkeypatch):
|
|
211
|
+
monkeypatch.setitem(sys.modules, "sherpa_onnx", None) # import raises ImportError
|
|
212
|
+
REAL_FEATURES.cache_clear()
|
|
213
|
+
try:
|
|
214
|
+
assert REAL_FEATURES() == SherpaFeatures()
|
|
215
|
+
finally:
|
|
216
|
+
REAL_FEATURES.cache_clear()
|
|
217
|
+
|
|
218
|
+
|
|
128
219
|
def test_sherpa_tokenization_fallback_passes_terms(fake, monkeypatch, tmp_path):
|
|
129
220
|
monkeypatch.setattr(sherpa, "features", lambda: SherpaFeatures(True, True, False))
|
|
130
221
|
dec = SherpaTransducer(_model_dir(tmp_path))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.18.9"
|
|
@@ -543,9 +543,18 @@ def cmd_maintain(args: argparse.Namespace) -> None:
|
|
|
543
543
|
that is stopped the moment you're back and started again (it resumes)
|
|
544
544
|
once you're away (voiceio.learn.quiet)."""
|
|
545
545
|
_yield_cpu()
|
|
546
|
+
from voiceio.learn import lastrun, quiet
|
|
547
|
+
if os.environ.get(quiet.WORKER_ENV) == "1": # a --when-idle worker: the parent records
|
|
548
|
+
_maintain(args, _maintain_settings(args))
|
|
549
|
+
return
|
|
550
|
+
with lastrun.recording(): # what `learn report` says about the last run
|
|
551
|
+
_maintain_recorded(args)
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
def _maintain_recorded(args: argparse.Namespace) -> None:
|
|
546
555
|
from voiceio.learn import quiet
|
|
547
556
|
learn_cfg = _maintain_settings(args)
|
|
548
|
-
if getattr(args, "when_idle", False)
|
|
557
|
+
if getattr(args, "when_idle", False):
|
|
549
558
|
from voiceio.config import private_dir
|
|
550
559
|
private_dir(store.learn_dir())
|
|
551
560
|
code = quiet.run_while_away(
|
|
@@ -594,6 +603,8 @@ def _maintain(args: argparse.Namespace, learn_cfg) -> None:
|
|
|
594
603
|
current = evaluate.latest(_cfg().model.name, ds.name, beam=beam) or _scores(_run_eval(None, ds))
|
|
595
604
|
run = _finished_run(ds, learn_cfg.base) or _train(ds, base=learn_cfg.base,
|
|
596
605
|
epochs=learn_cfg.epochs)
|
|
606
|
+
from voiceio.learn import lastrun
|
|
607
|
+
lastrun.mark_retrained()
|
|
597
608
|
model = str(run / "ct2")
|
|
598
609
|
candidate = evaluate.latest(model, ds.name, beam=beam) or _scores(_run_eval(model, ds))
|
|
599
610
|
with quiet.hold(): # from here on: seconds of work that must not be torn
|
|
@@ -23,9 +23,11 @@ def register(sub: argparse._SubParsersAction) -> None:
|
|
|
23
23
|
d = msub.add_parser("download", help="Fetch a sherpa-onnx model (e.g. parakeet-tdt-0.6b-v2)")
|
|
24
24
|
d.add_argument("name")
|
|
25
25
|
d.set_defaults(func=cmd_download)
|
|
26
|
-
s = msub.add_parser("sherpa", help="Install sherpa-onnx with the
|
|
27
|
-
"
|
|
26
|
+
s = msub.add_parser("sherpa", help="Install or upgrade sherpa-onnx to a release with the "
|
|
27
|
+
"Parakeet fixes (2.0.2+)")
|
|
28
28
|
s.add_argument("--check", action="store_true", help="only say what is installed")
|
|
29
|
+
s.add_argument("--patched", action="store_true",
|
|
30
|
+
help="install voiceio's old patched build instead of the PyPI release")
|
|
29
31
|
s.set_defaults(func=cmd_sherpa)
|
|
30
32
|
|
|
31
33
|
|
|
@@ -49,15 +51,16 @@ def _fine_tunes() -> list[str]:
|
|
|
49
51
|
|
|
50
52
|
def _sherpa_note() -> str:
|
|
51
53
|
"""Why Parakeet is or isn't usable with the installed sherpa-onnx."""
|
|
54
|
+
from voiceio.core.decoders.fetch import SHERPA_REQUIREMENT
|
|
52
55
|
from voiceio.core.decoders.sherpa import features
|
|
53
56
|
f = features()
|
|
57
|
+
fix = f"pip install -U '{SHERPA_REQUIREMENT}' (or: voiceio models sherpa)"
|
|
54
58
|
if not f.installed:
|
|
55
|
-
return "needs sherpa-onnx:
|
|
59
|
+
return f"needs sherpa-onnx: {fix}"
|
|
56
60
|
if not f.length_reward:
|
|
57
|
-
return
|
|
58
|
-
"voiceio models sherpa")
|
|
61
|
+
return f"this sherpa-onnx lacks the NeMo TDT beam-search fix (no hotwords): {fix}"
|
|
59
62
|
if not f.pretokenized_hotwords:
|
|
60
|
-
return "hotwords via sherpa's own tokenization (fewer names caught):
|
|
63
|
+
return f"hotwords via sherpa's own tokenization (fewer names caught): {fix}"
|
|
61
64
|
return ""
|
|
62
65
|
|
|
63
66
|
|
|
@@ -133,7 +136,8 @@ def cmd_use(args: argparse.Namespace) -> None:
|
|
|
133
136
|
if runtime_of(name) == "sherpa-onnx":
|
|
134
137
|
from voiceio.core.decoders.sherpa import features
|
|
135
138
|
if not features().installed:
|
|
136
|
-
raise SystemExit("needs sherpa-onnx first:
|
|
139
|
+
raise SystemExit("needs sherpa-onnx first: "
|
|
140
|
+
"pip install 'python-voiceio[sherpa]'")
|
|
137
141
|
if note := _sherpa_note():
|
|
138
142
|
print(f"note: {note}")
|
|
139
143
|
if m is not None and m.url:
|
|
@@ -167,20 +171,25 @@ def cmd_download(args: argparse.Namespace) -> None:
|
|
|
167
171
|
|
|
168
172
|
|
|
169
173
|
def cmd_sherpa(args: argparse.Namespace) -> None:
|
|
170
|
-
"""
|
|
171
|
-
|
|
174
|
+
"""Install or upgrade sherpa-onnx in this Python to a release with
|
|
175
|
+
Parakeet's fixes (upstream 2.0.2+; `--patched`: voiceio's old build)."""
|
|
172
176
|
from voiceio.core.decoders import fetch
|
|
173
177
|
note = _sherpa_note()
|
|
174
178
|
if args.check or not note:
|
|
175
179
|
print(note or "sherpa-onnx has the Parakeet fixes (beam-search fix, pre-tokenized "
|
|
176
180
|
"hotwords)")
|
|
177
181
|
return
|
|
178
|
-
print(f"installing the patched sherpa-onnx from {fetch.SHERPA_WHEELS}…", flush=True)
|
|
179
182
|
try:
|
|
180
|
-
|
|
183
|
+
if args.patched:
|
|
184
|
+
print(f"installing the patched sherpa-onnx from {fetch.SHERPA_WHEELS}…", flush=True)
|
|
185
|
+
what = fetch.install_patched_sherpa()
|
|
186
|
+
else:
|
|
187
|
+
print(f"installing {fetch.SHERPA_REQUIREMENT} from PyPI…", flush=True)
|
|
188
|
+
fetch.install_sherpa()
|
|
189
|
+
what = fetch.SHERPA_REQUIREMENT
|
|
181
190
|
except OSError as e:
|
|
182
191
|
raise SystemExit(str(e)) from e
|
|
183
192
|
from voiceio import config
|
|
184
193
|
from voiceio.core.decoders.catalog import PARAKEET, PARAKEET_V3
|
|
185
194
|
name = PARAKEET if config.load().model.language == "en" else PARAKEET_V3
|
|
186
|
-
print(f"installed {
|
|
195
|
+
print(f"installed {what}\nnext: voiceio models use {name} (or `use auto`)")
|
|
@@ -63,8 +63,7 @@ def _sherpa(model_cfg) -> Decoder:
|
|
|
63
63
|
from voiceio.core.decoders import fetch
|
|
64
64
|
from voiceio.core.decoders.sherpa import SherpaTransducer, default_threads, features
|
|
65
65
|
if not features().installed: # before a 500 MB download it couldn't use
|
|
66
|
-
raise DecodeError("sherpa-onnx not installed: pip install 'python-voiceio[sherpa]'
|
|
67
|
-
"(or the build with the Parakeet fixes: voiceio models sherpa)")
|
|
66
|
+
raise DecodeError("sherpa-onnx not installed: pip install 'python-voiceio[sherpa]'")
|
|
68
67
|
name = model_cfg.name
|
|
69
68
|
if name.startswith("sherpa:"):
|
|
70
69
|
model_dir = Path(name.split(":", 1)[1]).expanduser()
|
|
@@ -142,11 +142,13 @@ def print_progress(label: str) -> Callable[[int, int], None]:
|
|
|
142
142
|
return show
|
|
143
143
|
|
|
144
144
|
|
|
145
|
-
# ──
|
|
146
|
-
#
|
|
147
|
-
# pre-tokenized hotwords,
|
|
148
|
-
|
|
149
|
-
#
|
|
145
|
+
# ── sherpa-onnx ──────────────────────────────────────────────────────────
|
|
146
|
+
# Parakeet's biasing needs the NeMo TDT beam-search fix (k2-fsa/sherpa-onnx
|
|
147
|
+
# #4084) and pre-tokenized hotwords (#4088), both released upstream in 2.0.2.
|
|
148
|
+
SHERPA_REQUIREMENT = "sherpa-onnx>=2.0.2"
|
|
149
|
+
# Before that release: Hugo0/sherpa-onnx branch `voiceio-patched`, built by the
|
|
150
|
+
# voiceio repo's "sherpa-wheels" workflow into this release, with a SHA256SUMS
|
|
151
|
+
# file (`voiceio models sherpa --patched`).
|
|
150
152
|
SHERPA_WHEELS = "https://github.com/Hugo0/voiceio/releases/download/sherpa-onnx-voiceio"
|
|
151
153
|
|
|
152
154
|
|
|
@@ -176,8 +178,6 @@ def patched_sherpa_wheel(sums: str, version: tuple[int, int] | None = None,
|
|
|
176
178
|
def install_patched_sherpa(base_url: str = SHERPA_WHEELS) -> str:
|
|
177
179
|
"""Download, verify and install the patched sherpa-onnx wheel into this
|
|
178
180
|
Python. Returns the wheel's name; raises OSError with what went wrong."""
|
|
179
|
-
import shutil as _shutil
|
|
180
|
-
import subprocess
|
|
181
181
|
import sys
|
|
182
182
|
import tempfile
|
|
183
183
|
try:
|
|
@@ -202,16 +202,30 @@ def install_patched_sherpa(base_url: str = SHERPA_WHEELS) -> str:
|
|
|
202
202
|
raise OSError(f"{wheel}: checksum mismatch — not installing")
|
|
203
203
|
path.write_bytes(data)
|
|
204
204
|
# Same version number as upstream's release: force the swap.
|
|
205
|
-
|
|
206
|
-
if importlib.util.find_spec("pip") is not None:
|
|
207
|
-
cmd = [sys.executable, "-m", "pip", "install", "--force-reinstall", "--no-deps",
|
|
208
|
-
str(path)]
|
|
209
|
-
elif uv := _shutil.which("uv"):
|
|
210
|
-
cmd = [uv, "pip", "install", "--python", sys.executable, "--reinstall",
|
|
211
|
-
"--no-deps", str(path)]
|
|
212
|
-
else:
|
|
213
|
-
raise OSError(f"neither pip nor uv is available to install {wheel}")
|
|
214
|
-
rc = subprocess.run(cmd).returncode
|
|
215
|
-
if rc != 0:
|
|
216
|
-
raise OSError(f"installing {wheel} failed (exit {rc}): {' '.join(cmd)}")
|
|
205
|
+
_pip_install([str(path)], reinstall=True)
|
|
217
206
|
return wheel
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def install_sherpa() -> None:
|
|
210
|
+
"""Install or upgrade sherpa-onnx from PyPI to a release with the
|
|
211
|
+
Parakeet fixes. Raises OSError with what went wrong."""
|
|
212
|
+
_pip_install(["--upgrade", SHERPA_REQUIREMENT])
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def _pip_install(args: list[str], *, reinstall: bool = False) -> None:
|
|
216
|
+
"""pip (or uv) install into this Python; OSError on failure."""
|
|
217
|
+
import importlib.util
|
|
218
|
+
import shutil as _shutil
|
|
219
|
+
import subprocess
|
|
220
|
+
import sys
|
|
221
|
+
if importlib.util.find_spec("pip") is not None:
|
|
222
|
+
cmd = [sys.executable, "-m", "pip", "install"] + \
|
|
223
|
+
(["--force-reinstall", "--no-deps"] if reinstall else []) + args
|
|
224
|
+
elif uv := _shutil.which("uv"):
|
|
225
|
+
cmd = [uv, "pip", "install", "--python", sys.executable] + \
|
|
226
|
+
(["--reinstall", "--no-deps"] if reinstall else []) + args
|
|
227
|
+
else:
|
|
228
|
+
raise OSError(f"neither pip nor uv is available to install {args[-1]}")
|
|
229
|
+
rc = subprocess.run(cmd).returncode
|
|
230
|
+
if rc != 0:
|
|
231
|
+
raise OSError(f"installing {args[-1]} failed (exit {rc}): {' '.join(cmd)}")
|