mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-17 07:21:28 +00:00
Retain captions already produced by the selected model
This commit is contained in:
+26
-7
@@ -433,11 +433,31 @@ def cmd_caption(args: argparse.Namespace) -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
general_rows = [
|
general_rows = [
|
||||||
item for item in routed if item[1] == "general"
|
item
|
||||||
|
for item in routed
|
||||||
|
if item[1] == "general"
|
||||||
|
and (
|
||||||
|
args.force
|
||||||
|
or item[0]["caption"] is None
|
||||||
|
or item[0]["caption_model"] != settings.caption_general_model
|
||||||
|
)
|
||||||
]
|
]
|
||||||
specialist_rows = [
|
specialist_rows = [
|
||||||
item for item in routed if item[1] == "specialist"
|
item
|
||||||
|
for item in routed
|
||||||
|
if item[1] == "specialist"
|
||||||
|
and (
|
||||||
|
args.force
|
||||||
|
or item[0]["caption"] is None
|
||||||
|
or item[0]["caption_model"] != settings.caption_specialist_model
|
||||||
|
)
|
||||||
]
|
]
|
||||||
|
retained = len(routed) - len(general_rows) - len(specialist_rows)
|
||||||
|
if retained:
|
||||||
|
print(
|
||||||
|
f"Keeping {retained} existing caption(s) because they already use "
|
||||||
|
f"the model selected by the router."
|
||||||
|
)
|
||||||
|
|
||||||
print(f"General prompt: {settings.caption_prompt_file}")
|
print(f"General prompt: {settings.caption_prompt_file}")
|
||||||
print(f"Specialist prompt: {settings.caption_specialist_prompt_file}")
|
print(f"Specialist prompt: {settings.caption_specialist_prompt_file}")
|
||||||
@@ -460,11 +480,10 @@ def cmd_caption(args: argparse.Namespace) -> None:
|
|||||||
failed = general_failed + specialist_failed + missing
|
failed = general_failed + specialist_failed + missing
|
||||||
print(f"\nCaptioning complete: {completed} saved, {failed} failed/skipped.")
|
print(f"\nCaptioning complete: {completed} saved, {failed} failed/skipped.")
|
||||||
|
|
||||||
if completed:
|
if args.sync:
|
||||||
if args.sync:
|
cmd_sync_meili(args)
|
||||||
cmd_sync_meili(args)
|
elif completed:
|
||||||
else:
|
print("Next: python -m scene_search.cli sync-meili")
|
||||||
print("Next: python -m scene_search.cli sync-meili")
|
|
||||||
|
|
||||||
|
|
||||||
def cmd_status(_: argparse.Namespace) -> None:
|
def cmd_status(_: argparse.Namespace) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user