Support native Transformers loading

#9

I'm adding native Phi-3-vision support to Transformers in https://github.com/huggingface/transformers/pull/51214, and VLM2Vec-Full loads with the same classes. This PR declares <|image|> as the image token in tokenizer_config.json and sets rstrip: false on it (also in tokenizer.json); with the native processor, write <|image|> where the remote processor used <|image_1|>.

The remote code, auto_map and the weights are unchanged, so trust_remote_code=True keeps working: with transformers 4.48.3 the tokenization is identical with and without these files.

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment