Skip to content

Commit aec5efd

Browse files
fix: max_input_length should take into account position_offset
1 parent 021899d commit aec5efd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

router/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ async fn main() -> Result<()> {
217217
} else {
218218
0
219219
};
220+
let max_input_length = config.max_position_embeddings - position_offset;
220221

221222
let tokenization_workers = args
222223
.tokenization_workers
@@ -226,7 +227,7 @@ async fn main() -> Result<()> {
226227
let tokenization = Tokenization::new(
227228
tokenization_workers,
228229
tokenizer,
229-
config.max_position_embeddings,
230+
max_input_length,
230231
position_offset,
231232
);
232233

0 commit comments

Comments
 (0)