From 554acddc0c9eade0ffb62b29709d1aec597c3d7a Mon Sep 17 00:00:00 2001 From: albe873 <93786475+albe873@users.noreply.github.com> Date: Fri, 13 Dec 2024 23:14:57 +0100 Subject: [PATCH] added version parameter --- src/wyoming_whisper/__main__.py | 20 ++++++++++++++------ src/wyoming_whisper/handler.py | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/wyoming_whisper/__main__.py b/src/wyoming_whisper/__main__.py index 6e82983..c468ac2 100755 --- a/src/wyoming_whisper/__main__.py +++ b/src/wyoming_whisper/__main__.py @@ -21,6 +21,11 @@ async def main() -> None: default="medium", help="Name of whisper model to use (default medium)", ) + parser.add_argument( + "--language", + default="en", + help="Language to use for inference (default: en)", + ) parser.add_argument( "--uri", help="unix:// or tcp://", default="tcp://0.0.0.0:10300" ) @@ -34,16 +39,17 @@ async def main() -> None: default="cuda", help="Device to use for inference (default: cuda)", ) - parser.add_argument( - "--language", - default="en", - help="Default language to set for transcription (default: en)", - ) parser.add_argument( "--beam-size", type=int, default=5, ) + parser.add_argument( + "--version", + default="1.0", + help="Version of the whisper model to use (default: 1.0)", + ) + parser.add_argument("--debug", action="store_true", help="Log DEBUG messages") args = parser.parse_args() @@ -61,6 +67,7 @@ async def main() -> None: AsrProgram( name="whisper", description="Whisper", + version=args.version, attribution=Attribution( name="OpenAI", url="https://github.com/openai/whisper", @@ -69,6 +76,7 @@ async def main() -> None: models=[ AsrModel( name=args.model, + version=args.version, description=args.model, attribution=Attribution( name="whisper", @@ -100,4 +108,4 @@ if __name__ == "__main__": try: asyncio.run(main()) except KeyboardInterrupt: - pass + pass \ No newline at end of file diff --git a/src/wyoming_whisper/handler.py b/src/wyoming_whisper/handler.py index 793a03e..8aa413d 100644 --- a/src/wyoming_whisper/handler.py +++ b/src/wyoming_whisper/handler.py @@ -89,4 +89,4 @@ class FasterWhisperEventHandler(AsyncEventHandler): return False - return True + return True \ No newline at end of file