Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve handling of missing
vocab_file
attribute in HFTokenizerConv…
…erter (#677) 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.
- Loading branch information