From f7021704b6b26ee747558d9ad701c2b25baedd2a Mon Sep 17 00:00:00 2001 From: historia Date: Fri, 21 Aug 2026 02:31:54 -0400 Subject: feat: catalog-driven audio.cpp server.json creation --- audiobook.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'audiobook.py') diff --git a/audiobook.py b/audiobook.py index a984a0a..f177268 100755 --- a/audiobook.py +++ b/audiobook.py @@ -159,6 +159,20 @@ Examples: "chunk.") ) + parser.add_argument( + "--model", + type=str, + default=None, + metavar="ID", + help=("audio.cpp server model entry id to use for this run " + "(--backend audiocpp only). Overrides AUDIOCPP_MODEL_ID in " + "converter/config.py, which is useful for a server hosting " + "several lazily-loaded models: generate one server.json with " + "tools/make_audiocpp_server_json.py, then pick the model per " + "run with --model. Leave unset to use the config id, or to " + "auto-select when the server hosts exactly one entry.") + ) + args = parser.parse_args() if args.speed <= 0: @@ -221,6 +235,10 @@ Examples: print("[WARNING] --transcription/--no-transcription " "are ignored without --clone") + if args.model is not None and args.backend != BACKEND_AUDIOCPP: + parser.error("--model requires --backend audiocpp; it selects an " + "audio.cpp server model entry id") + setup_logging(debug=args.debug) setup_directories() @@ -265,6 +283,7 @@ Examples: voice=args.voice, debug=args.debug, chunk=args.chunk, + model_id=args.model, ) converter._book_files = book_files converter._planned = planned -- cgit v1.2.3