diff --git a/router/src/validation.rs b/router/src/validation.rs index 2d1d9a3d..dfe9dd4d 100644 --- a/router/src/validation.rs +++ b/router/src/validation.rs @@ -566,7 +566,7 @@ fn fetch_image(input: &str) -> Result<(Vec, 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!( diff --git a/server/text_generation_server/models/mllama_causal_lm.py b/server/text_generation_server/models/mllama_causal_lm.py index a9b610a1..c268ff9a 100644 --- a/server/text_generation_server/models/mllama_causal_lm.py +++ b/server/text_generation_server/models/mllama_causal_lm.py @@ -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"],