From c13b9d87c9f1a9776fa144007337bfa47369d1c3 Mon Sep 17 00:00:00 2001 From: OlivierDehaene Date: Mon, 17 Apr 2023 16:51:53 +0200 Subject: [PATCH] fix(router): fix truncation (#190) closes #189 --- router/src/validation.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/router/src/validation.rs b/router/src/validation.rs index d81a27e..5f1b89b 100644 --- a/router/src/validation.rs +++ b/router/src/validation.rs @@ -308,8 +308,8 @@ fn prepare_input( // Optionally truncate let (inputs, input_length) = match truncate { - // Truncate is some and > encoding length - Some(truncate) if truncate > encoding.len() => { + // Truncate is some and < encoding length + Some(truncate) if truncate < encoding.len() => { // truncate encoding and decode new inputs encoding.truncate(truncate, 0, TruncationDirection::Left); let inputs = tokenizer