azlanmalikai commited on
Commit
b122b5b
·
verified ·
1 Parent(s): 5b8643b

Add image_token_id to config.json

Browse files

Adds `image_token_id` to `config.json`, set to the id of `<IMG_CONTEXT>` in this repo's tokenizer (64000).

With it, this checkpoint loads into the native `InternVLForConditionalGeneration` in transformers without `trust_remote_code` (huggingface/transformers#47047), which reads the image token id from the config.

The remote code is unaffected: `InternVLChatConfig` keeps unknown keys as attributes, and `InternVLChatModel` still reads the id from the tokenizer.

Files changed (1) hide show
  1. config.json +1 -0
config.json CHANGED
@@ -11,6 +11,7 @@
11
  "downsample_ratio": 0.5,
12
  "dynamic_image_size": true,
13
  "force_image_size": 448,
 
14
  "llm_config": {
15
  "_name_or_path": "NousResearch/Nous-Hermes-2-Yi-34B",
16
  "add_cross_attention": false,
 
11
  "downsample_ratio": 0.5,
12
  "dynamic_image_size": true,
13
  "force_image_size": 448,
14
+ "image_token_id": 64000,
15
  "llm_config": {
16
  "_name_or_path": "NousResearch/Nous-Hermes-2-Yi-34B",
17
  "add_cross_attention": false,