From e1169eed226cd6f1f2f271cb121050a0125c15b9 Mon Sep 17 00:00:00 2001 From: Arthur <48595927+ArthurZucker@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:53:24 +0100 Subject: [PATCH] Update bindings/python/src/tokenizer.rs Co-authored-by: Nicolas Patry --- bindings/python/src/tokenizer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/src/tokenizer.rs b/bindings/python/src/tokenizer.rs index a4ec7b26f..45dfa09e7 100644 --- a/bindings/python/src/tokenizer.rs +++ b/bindings/python/src/tokenizer.rs @@ -1036,7 +1036,7 @@ impl PyTokenizer { is_pretokenized: bool, add_special_tokens: bool, ) -> PyResult> { - let mut items = Vec::::new(); + let mut items = Vec::::with_capacity(input.len()); for i in 0..input.len()? { let item = input.get_item(i)?; let item: tk::EncodeInput = if is_pretokenized {