SIGN IN SIGN UP

feat: Support SPM infill (#1492)

* Support SPM infill

* typo--

* one less layer of parenthesis necessary

* new required internals

* manually add bos/eos if model requires it

* add bos even when unknown

This is identical behaviour to llama.cpp

I guess any model that doesn't use BOS is recent enough to have the add_bos_token metadata.

* don't add bos/eos on non-infill pre-tokenized prompt

* add tokenizer hack to remove leading space in suffix

* I keep forgetting metadata are strings

* check if bos exists

* add example

* add cls/sep instead of bos/eos for WPM vocab

* simplify

* color-code filtered suffix

---------

Co-authored-by: Andrei Betlen <abetlen@gmail.com>
S
Sigbjørn Skjæret committed
dbcf64cf0796c27a241991ef6fd0e52283eeb462
Parent: e342161
Committed by GitHub <noreply@github.com> on 6/13/2024, 7:45:24 AM