This commit is contained in:
Nicolas Patry 2025-04-07 09:39:00 +02:00
parent 10a5dfee70
commit da5f2a82e9
No known key found for this signature in database
GPG Key ID: 87B37D879D09DEB4
2 changed files with 5 additions and 5 deletions

View File

@ -566,7 +566,7 @@ fn fetch_image(input: &str) -> Result<(Vec<u8>, String, usize, usize), Validatio
return Err(ValidationError::InvalidImageContent(content.to_string()));
}
let data = STANDARD.decode(content["base64,".len()..].as_bytes())?;
let data = STANDARD.decode(&content["base64,".len()..])?;
let img = if let Some(format) = format_from_mimetype(mimetype) {
ImageReader::with_format(Cursor::new(&data), format).decode()?
} else {
@ -603,7 +603,7 @@ fn image_tokens(
let mut image_string = String::with_capacity(2 * FAKE.len() + slots * IMAGE.len());
image_string.push_str(FAKE);
image_string.extend(iter::repeat(IMAGE).take(slots));
image_string.extend(iter::repeat_n(IMAGE, slots));
image_string.push_str(FAKE);
if matches!(

View File

@ -350,9 +350,9 @@ class MllamaCausalLM(VlmCausalLM):
cuda_graph["input_lengths"].zero_()
cuda_graph["input_lengths"][: input_lengths.shape[0]] = input_lengths
cuda_graph["cache_lengths"].zero_()
cuda_graph["cache_lengths"][: cache_lengths_tensor.shape[0]] = (
cache_lengths_tensor
)
cuda_graph["cache_lengths"][
: cache_lengths_tensor.shape[0]
] = cache_lengths_tensor
with self._forward_context(
block_tables=cuda_graph["block_tables"],