-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
User Story
As a developer using FrameStory,
I want robust error handling in the describe_frames method
so that caption generation failures don't crash the entire video processing pipeline.
Background
The current implementation of describe_frames in frame_story/video_describer.py lacks error handling around the image captioning model calls. If the model fails (e.g., due to invalid inputs, API issues, or hardware constraints), uncaught exceptions propagate upward, halting all processing. This is particularly risky given the dependency on external ML models and video input variability. The describe_frames method's loop (lines 45-60) needs structured exception handling to maintain pipeline resilience.
Acceptance Criteria
- Modify
frame_story/video_describer.pywith error handling indescribe_frames:- Wrap model interactions (
processor()andmodel.generate()) in try/except blocks - Log errors with context (frame index, timestamp) using Python's logging module
- Continue processing subsequent frames after failures
- Wrap model interactions (
- Ensure error messages include:
- Timestamp of failed frame
- Exception type
- Brief diagnostic info (without exposing model internals)
- Add validation that:
- Simulated model failures during testing don't crash the process
- Error details appear in application logs
- At least 90% of valid frames get processed despite individual failures
- Update tests in
tests/test_video_describer.pyto verify error containment
Reactions are currently unavailable