Instructions to use McGill-NLP/LLM2Vec-Meta-Llama-31-8B-Instruct-mntp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use McGill-NLP/LLM2Vec-Meta-Llama-31-8B-Instruct-mntp with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("McGill-NLP/LLM2Vec-Meta-Llama-31-8B-Instruct-mntp", trust_remote_code=True) model = AutoModel.from_pretrained("McGill-NLP/LLM2Vec-Meta-Llama-31-8B-Instruct-mntp", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Can't load the model
In config.json file, there is: "architectures": [
"LlamaEncoderModel"
],
"auto_map": {
"AutoModel": "McGill-NLP/LLM2Vec-Meta-Llama-31-8B-Instruct-mntp--modeling_llama_encoder.LlamaEncoderModel"
}
But in modeling_llama_encoder.py, the model name is "BidirectionalLlama", not "LlamaEncoderModel". So when I tried to load the model, such error occurred:AttributeError: module 'transformers_modules.McGill-NLP.LLM2Vec-Meta-Llama-31-8B-Instruct-mntp.1d49bff4203a867109580085c67e3b3cc2984a89.modeling_llama_encoder' has no attribute 'LlamaEncoderModel'
Thanks for bringing this to my attention. I have fixed this. Can you check now?
Thank you for fixing this. I can load the model correctly now :)