Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions freevideo_engine/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ def main():
help='Measure the placement questions this machine can settle')
calibrate.add_argument('arguments', nargs=argparse.REMAINDER)
args = parser.parse_args()
if args.command == 'generate':
# Check the input before detection and planning. A mistyped or empty prompt
# file failed only after <out>.artifacts was created, and every retry with
# the same --out then stopped at FileExistsError.
if args.prompt_file:
if not args.prompt_file.read_text(encoding='utf-8').strip():
raise ValueError('A nonempty prompt is required')
elif not args.conditioning.is_file():
raise FileNotFoundError(f'Conditioning file not found: {args.conditioning}')
if sys.platform == 'darwin' and args.command in ('plan', 'generate', 'encode', 'doctor'):
from .macos_generate import dispatch
return dispatch(args)
Expand Down