diff options
| author | historia <historiavg@proton.me> | 2026-08-21 02:31:54 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-21 02:31:54 -0400 |
| commit | f7021704b6b26ee747558d9ad701c2b25baedd2a (patch) | |
| tree | feda79e97ad0d6601558123bfe9093cfc4ac66e9 /audiobook.py | |
| parent | fea9222740da007f1d7befcd7dee035265c0e5d1 (diff) | |
| download | tts-audiobook-generator-f7021704b6b26ee747558d9ad701c2b25baedd2a.tar.gz | |
feat: catalog-driven audio.cpp server.json creation
Diffstat (limited to 'audiobook.py')
| -rwxr-xr-x | audiobook.py | 19 |
1 files changed, 19 insertions, 0 deletions
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 |
