Skip to content

Commit

Permalink
convert : support loading vocab from fast tokenizer config (ggerganov…
Browse files Browse the repository at this point in the history
…#3633)

* Add HFVocab into convert.py

* Update convert.py

* Update convert.py

* add bytes_to_unicode function

* change add_meta_vocab fucntion

* remove debug code

* remove byte_encoder

* Add newline between classes

* Check tokenizer.json when tokenizer.model is not exist.

* Move transformers dependency to local code

* Add error context with 'raise from'

* Add fast tokenizer option to BpeVocab

* Update convert.py

* Add VocabLoader and remove *Vocab class

* Add transformers dependency

* remove added tokens and check newline token to decide spm or bpe

* Update convert.py

* Add special token type

* Update convert.py

* Update convert.py

* Update convert.py

* Fix typo in convert.py

* Fix when params.n_vocab < tokenizer vocab size

* update vocab class

* change funtion name

* Remove unused variable/functions, add types to class variable and methods, delete blank liens

* fix flake8 warnings

* code style cleanup

* make mypy happy

* change exception

---------

Co-authored-by: Jared Van Bortel <[email protected]>
  • Loading branch information
2 people authored and teleprint-me committed Dec 21, 2023
1 parent 69bf457 commit 8628f87
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 150 deletions.
Loading

0 comments on commit 8628f87

Please sign in to comment.