File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,16 +96,15 @@ struct mtmd_image_tokens {
9696 // [BOI] [row0 tokens + newline] ... [row(ny-1) tokens + newline] [EOI]
9797 return (nx + 1 ) * ny + 2 ;
9898 }
99- // [QWEN_VIDEO] this logic is quite ugly, it's mostly to make qwen-vl temporal merge work, can be improved in the future
100- if (batch_f32.entries .size () == 1 || n_temporal_merge == 1 ) {
101- return nx * ny;
102- }
10399 uint32_t nz = batch_f32.entries .size ();
104- // TODO: simplify this by repeating the last frame until it fits the temporal merge
105- if (nz % n_temporal_merge != 0 ) {
106- nz = nz / n_temporal_merge + 1 ;
107- } else {
108- nz = nz / n_temporal_merge;
100+ if (n_temporal_merge > 1 ) {
101+ // [QWEN_VIDEO] this logic is quite ugly, it's mostly to make qwen-vl temporal merge work, can be improved in the future
102+ // TODO: simplify this by repeating the last frame until it fits the temporal merge
103+ if (nz % n_temporal_merge != 0 ) {
104+ nz = nz / n_temporal_merge + 1 ;
105+ } else {
106+ nz = nz / n_temporal_merge;
107+ }
109108 }
110109 return nx * ny * nz;
111110 }
You can’t perform that action at this time.
0 commit comments