aboutsummaryrefslogtreecommitdiff
path: root/audiobook.py
diff options
context:
space:
mode:
Diffstat (limited to 'audiobook.py')
-rwxr-xr-xaudiobook.py19
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