We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08d4200 commit a10cce2Copy full SHA for a10cce2
crates/bpe/src/byte_pair_encoding.rs
@@ -604,7 +604,7 @@ impl BytePairEncoding {
604
best = (m.value(), 1);
605
break;
606
} else if (last_token[m.start() - 1].1 + 1 < best.1)
607
- & !(forbidden_tokens_set.contains(&m.value()))
+ & (!(forbidden_tokens_set.contains(&m.value())) | ((m.end() - m.start()) == 1))
608
{
609
best = (m.value(), last_token[m.start() - 1].1 + 1);
610
}
0 commit comments