depot/third_party/nixpkgs/pkgs/tools/audio/wyoming/faster-whisper-entrypoint.patch

33 lines
862 B
Diff
Raw Normal View History

diff --git a/setup.py b/setup.py
index 04eedbc..ee0b495 100644
--- a/setup.py
+++ b/setup.py
@@ -35,4 +35,9 @@ setup(
"Programming Language :: Python :: 3.10",
],
keywords="rhasspy wyoming whisper",
+ entry_points={
+ 'console_scripts': [
+ 'wyoming-faster-whisper = wyoming_faster_whisper:__main__.run'
+ ]
+ }
)
diff --git a/wyoming_faster_whisper/__main__.py b/wyoming_faster_whisper/__main__.py
index 8a5039f..bd1e7b6 100755
--- a/wyoming_faster_whisper/__main__.py
+++ b/wyoming_faster_whisper/__main__.py
@@ -131,8 +131,12 @@ async def main() -> None:
# -----------------------------------------------------------------------------
+def run():
+ asyncio.run(main())
+
+
if __name__ == "__main__":
try:
- asyncio.run(main())
+ run()
except KeyboardInterrupt:
pass