huggingface / huggingface/nanoVLM

AttributeError: 'GPT2TokenizerFast' object has no attribute 'image_token_id'

Open
#136 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5k
Forks
510
PR merge metrics
No merged PRs in 30d

Description

After running generate.py, I got this error:

---

Traceback (most recent call last):
File "L:\Deeplearning\Nano_VLM\generate.py", line 69, in
main()
File "L:\Deeplearning\Nano_VLM\generate.py", line 63, in main
gen = model.generate(tokens, img_t, max_new_tokens=args.max_new_tokens)
File "G:\ANACONDA\envs\janus_pro\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "L:\Deeplearning\Nano_VLM\models\vision_language_model.py", line 89, in generate
initial_combined_embeds = self._replace_img_tokens_with_embd(input_ids, prompt_token_embeds, image_embd)
File "L:\Deeplearning\Nano_VLM\models\vision_language_model.py", line 46, in _replace_img_tokens_with_embd
mask = (input_ids == self.tokenizer.image_token_id)
**AttributeError: 'GPT2TokenizerFast' object has no attribute 'image_token_id'**

---

It seems that there are some problems with the pre-downloaded tokenizer.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.