Closed kazssym closed 3 months ago
This commit updates HFTokenizerConverter to handle cases where the hf_tokenizer object might not have a vocab_file attribute.
HFTokenizerConverter
hf_tokenizer
vocab_file
Changes:
getattr
None
This ensures the converter works correctly even with tokenizers that don't define a vocab_file attribute.
I'm not sure but it looks like GPT2Tokenizer/-Fast lacks the vocab_file attribute.
GPT2Tokenizer/-Fast
/azp run onnxruntime-extensions.CI
This commit updates
HFTokenizerConverter
to handle cases where thehf_tokenizer
object might not have avocab_file
attribute.Changes:
getattr
to retrieve thevocab_file
attribute for flexibilityvocab_file
for clarityvocab_file
isNone
before checking its existenceThis ensures the converter works correctly even with tokenizers that don't define a
vocab_file
attribute.