Skip to content

Commit

Permalink
fix: max_input_length should take into account position_offset
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierDehaene committed Oct 19, 2023
1 parent 021899d commit aec5efd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion router/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ async fn main() -> Result<()> {
} else {
0
};
let max_input_length = config.max_position_embeddings - position_offset;

let tokenization_workers = args
.tokenization_workers
Expand All @@ -226,7 +227,7 @@ async fn main() -> Result<()> {
let tokenization = Tokenization::new(
tokenization_workers,
tokenizer,
config.max_position_embeddings,
max_input_length,
position_offset,
);

Expand Down

0 comments on commit aec5efd

Please sign in to comment.