Skip to content

Question about auto_map usage in config.json for LlamaEncoderModel #62

@ly1998117

Description

@ly1998117

Hi, thanks for your great work on LLM2CLIP

I noticed that in the config.json of microsoft/LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned, there is an auto_map field pointing to:

"auto_map": {
"AutoModel": "McGill-NLP/LLM2Vec-Meta-Llama-3-8B-Instruct-mntp--modeling_llama_encoder.LlamaEncoderModel"
}

This makes AutoModel.from_pretrained() load the model class from the McGill-NLP repository via trust_remote_code=True and HuggingFace’s dynamic module mechanism.

However, this repo already includes a local implementation of LlamaEncoderModel in modeling_llama_encoder.py. I tried deleting auto_map and loading the checkpoint with the local class instead. The model loads successfully with no missing or unexpected keys.

May I ask what the original motivation was for adding this cross-repo auto_map? Is there any functional reason the model must be loaded from
the McGill-NLP repo rather than using the local implementation here?

Thanks again for the great work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions