Skip to content

Commit 8c507c3

Browse files
fix: only use position offset for xlm-roberta
1 parent bd34ca5 commit 8c507c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

router/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ async fn main() -> Result<()> {
212212
tokenizer.with_padding(None);
213213

214214
// Position IDs offset. Used for Roberta.
215-
let position_offset = if config.pad_token_id == 0 {
216-
0
217-
} else {
215+
let position_offset = if &config.model_type == "xlm-roberta" {
218216
config.pad_token_id + 1
217+
} else {
218+
0
219219
};
220220

221221
let tokenization_workers = args

0 commit comments

Comments
 (0)