Skip to content

Commit

Permalink
Fix some video output and image output pipeline bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
nking-1 committed Feb 11, 2025
1 parent 1c2d1a9 commit e467879
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions client/graphpaper-inline/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ For upcoming features, we won't be able to send all details over the wire, and w
} else if (isImageOutput(msg.node_attr)) {
console.log("Image available.");
textComponents.push(msg.node_attr);
} else if (isVideoOutput(msg.node_attr)) {
console.log("Video available.");
textComponents.push(msg.node_attr);
}
} else if (isVideoOutput(msg.node_attr)) {
console.log("Video available.");
textComponents.push(msg.node_attr);
}
} else if (isExecutionStartedMessage(msg)) {
requireFullReplay = false;
Expand Down
2 changes: 1 addition & 1 deletion guidance/library/_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def video(lm, src: typing.Union[str, pathlib.Path, bytes], allow_local: bool = T
def gen_video(lm):
# TODO(nopdive): Mock for testing. Remove all of this code later.
with open(
pkg_resources.resource_filename("guidance", "resources/sample_video.wav"), "rb"
pkg_resources.resource_filename("guidance", "resources/sample_video.mp4"), "rb"
) as f:
bytes_data = f.read()
base64_string = base64.b64encode(bytes_data).decode('utf-8')
Expand Down
4 changes: 2 additions & 2 deletions guidance/models/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
CaptureOutput,
TraceHandler,
)
from ..trace._trace import AudioOutput, AudioInput, VideoInput, VideoOutput
from ..trace._trace import AudioOutput, AudioInput, ImageInput, ImageOutput, VideoInput, VideoOutput
from ..visual import (
TraceMessage,
AutoRenderer,
Expand Down Expand Up @@ -1133,7 +1133,7 @@ def __add__(self, value):
elif isinstance(value, CaptureOutput):
out = lm
out._update_trace_node(out._id, out._parent_id, value)
elif isinstance(value, (AudioOutput, AudioInput, VideoInput, VideoOutput)):
elif isinstance(value, (AudioOutput, AudioInput, ImageInput, ImageOutput, VideoInput, VideoOutput)):
# TODO(nopdive): This is used for testing, consider removing when fully attached to model execution.
out = lm
out._update_trace_node(out._id, out._parent_id, value)
Expand Down
Loading

0 comments on commit e467879

Please sign in to comment.