Skip to content

Conversation

kazssym
Copy link
Contributor

@kazssym kazssym commented Mar 24, 2024

This pull request adds experimental GPTNeoXTokenizer support.

kazssym added 3 commits March 24, 2024 17:39
…erter

This commit updates `HFTokenizerConverter` to handle cases where the `hf_tokenizer` object might not have a `vocab_file` attribute.

Changes:

* Uses `getattr` to retrieve the `vocab_file` attribute for flexibility
* Stores the retrieved value in a separate variable `vocab_file` for clarity
* Checks if `vocab_file` is `None` before checking its existence

This ensures the converter works correctly even with tokenizers that don't define a `vocab_file` attribute.
This commit adds support for the `GPTNeoXTokenizer` class from Hugging Face Transformers to the `HFTokenizerConverter` in the `onnxruntime_extensions` library.

Specifically, it includes a new entry in the `_PROCESSOR_DICT` dictionary for `GPTNeoXTokenizer`, referencing the existing `HFTokenizerConverter.bpe_tokenizer` and `HFTokenizerConverter.bpe_decoder` functions for handling tokenization and decoding.

This allows seamless integration of GPTNeoX models with ONNX Runtime through the `HFTokenizerConverter`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant