Assertions to exceptions (#13692)
Assertions to exceptions (#13692)

* Raise exceptions instead of using assertions for control flow #12789

* # coding=utf-8

* Raise exceptions instead of using assertions for control flow

* Raise exceptions instead of using assertions for control flow

* Update src/transformers/tokenization_utils.py

Raise exceptions instead of using assertions for control flow

Co-authored-by: Suraj Patil <e55124f2bc241ddfef100229e12a1887b326eb73@gmail.com>

* Update src/transformers/tokenization_utils.py

Raise exceptions instead of using assertions for control flow

Co-authored-by: Sylvain Gugger <222c4d44cc8ec39802c192ed0aa3f97cdb77ff4e@users.noreply.github.com>

* Raise exceptions instead of using assertions for control flow

* test

* Raise exceptions instead of using assertions for control flow

Co-authored-by: MocktaiLEngineer <b52ce1fa1447ad0af0c9bc070308af670b1a9548@gmail.com>
Co-authored-by: Suraj Patil <e55124f2bc241ddfef100229e12a1887b326eb73@gmail.com>
Co-authored-by: Sylvain Gugger <222c4d44cc8ec39802c192ed0aa3f97cdb77ff4e@users.noreply.github.com>
huggingface/transformers,huggingface/transformers,huggingface/transformers,huggingface/transformers