# Can't load tokenizer using from\_pretrained, Inference API

**URL:** <https://discuss.huggingface.co/t/cant-load-tokenizer-using-from-pretrained-inference-api/85235>\
**Category:** 🤗Tokenizers\
**Created:** [May 5, 2024, 8:59am UTC](https://discuss.huggingface.co/t/cant-load-tokenizer-using-from-pretrained-inference-api/85235 "2024-05-05T08:59:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asif00](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@asif00](https://discuss.huggingface.co/u/asif00)\
**Post date:** [May 5, 2024, 8:59am UTC](https://discuss.huggingface.co/t/cant-load-tokenizer-using-from-pretrained-inference-api/85235/1 "2024-05-05T08:59:12Z")

</div>

`Can't load tokenizer using from_pretrained, please update its configuration: data did not match any variant of untagged enum PyPreTokenizerTypeWrapper at line 560, column 3`

Here are my project files: [Files](https://huggingface.co/asif00/mbart_bn_error_correction/tree/main).  
I could use the model locally from the local checkpoint folder after the finetune; however, when I upload the same checkpoint folder on hugginceface as a model, it doesn’t seem to work anymore. Could anyone please help me with that! Thank you!

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](https://discuss.huggingface.co/u/nielsr)\
**Post date:** [May 6, 2024, 9:00am UTC](https://discuss.huggingface.co/t/cant-load-tokenizer-using-from-pretrained-inference-api/85235/2 "2024-05-06T09:00:37Z")

</div>

Thanks for reporting, will forward to the team!

Duplicate of [Model Inference API error](https://discuss.huggingface.co/t/model-inference-api-error/85265)

---

<div class="post-metadata">

**Author:** ![asif00](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@asif00](https://discuss.huggingface.co/u/asif00)\
**Post date:** [May 6, 2024, 10:09am UTC](https://discuss.huggingface.co/t/cant-load-tokenizer-using-from-pretrained-inference-api/85235/4 "2024-05-06T10:09:19Z")

</div>

Thank you! Looking forward to hearing from the team!!!

---

<div class="post-metadata">

**Author:** ![asif00](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@asif00](https://discuss.huggingface.co/u/asif00)\
**Post date:** [May 6, 2024, 12:41pm UTC](https://discuss.huggingface.co/t/cant-load-tokenizer-using-from-pretrained-inference-api/85235/5 "2024-05-06T12:41:01Z")

</div>

Could use the same model uploaded on [Kaggle](https://www.kaggle.com/code/asif00/bengali-sentence-error-correction-custom-model). However, when used with AutoTokenizer, it complained, worked with MBart50Tokenizer.

---

<div class="post-metadata">

**Author:** ![asif00](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@asif00](https://discuss.huggingface.co/u/asif00)\
**Post date:** [May 6, 2024, 12:55pm UTC](https://discuss.huggingface.co/t/cant-load-tokenizer-using-from-pretrained-inference-api/85235/6 "2024-05-06T12:55:30Z")

</div>

Update: Works with MBart50Tokenizer from the HuggingFace checkpoint as well. Here is the [Space](https://huggingface.co/spaces/asif00/Bengali_Sentence_Error_Correction__mbart_bn_error_correction) I was testing it.
