Skip to content

Commit

Permalink
fix: pre commit and clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
drbh committed Dec 12, 2024
1 parent 44147fd commit 65c2d79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backends/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl ChunksToString for Vec<InputChunk> {
data,
mimetype,
width,
height,
height: _,
frames: _,
})) => {
// TODO: revisit if we should limit video support to v3 - to avoid sending very large base64 strings
Expand Down
6 changes: 4 additions & 2 deletions server/text_generation_server/models/vlm_causal_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,16 @@ def batch_tokenized_inputs(
)
num_bytes = len(video_frame_buf)
bytes_per_frame = num_bytes // chunk.video.frames

# iterate over with a stride the size of a frame
frames = []
for i in range(chunk.video.frames):
frame = video_frame_buf[
i * bytes_per_frame : (i + 1) * bytes_per_frame
]
frame = frame.reshape(chunk.video.height, chunk.video.width, 3)
frame = frame.reshape(
chunk.video.height, chunk.video.width, 3
)
frames.append(frame)

video_frame_buf = np.stack(frames)
Expand Down

0 comments on commit 65c2d79

Please sign in to comment.