Skip to content

Commit

Permalink
feature: better error message when file not found
Browse files Browse the repository at this point in the history
  • Loading branch information
brycedrennan committed Nov 23, 2023
1 parent aa91d0a commit a126e1c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
33 changes: 18 additions & 15 deletions imaginairy/cli/videogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,21 @@ def videogen_cmd(
configure_logging()

output_fps = output_fps or fps

generate_video(
input_path=start_image,
num_frames=num_frames,
num_steps=steps,
model_name=model,
fps_id=fps,
output_fps=output_fps,
motion_bucket_id=motion_amount,
cond_aug=cond_aug,
seed=seed,
decoding_t=decoding_t,
output_folder=output_folder,
repetitions=repeats,
)
try:
generate_video(
input_path=start_image,
num_frames=num_frames,
num_steps=steps,
model_name=model,
fps_id=fps,
output_fps=output_fps,
motion_bucket_id=motion_amount,
cond_aug=cond_aug,
seed=seed,
decoding_t=decoding_t,
output_folder=output_folder,
repetitions=repeats,
)
except FileNotFoundError as e:
logger.error(str(e))
exit(1)
3 changes: 2 additions & 1 deletion imaginairy/video_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def generate_video(
if len(all_img_paths) == 0:
raise ValueError("Folder does not contain any images.")
else:
raise ValueError
msg = f"Could not find file or folder at {input_path}"
raise FileNotFoundError(msg)

expected_size = (1024, 576)
for _ in range(repetitions):
Expand Down

0 comments on commit a126e1c

Please sign in to comment.