Cant run the model with the most basic code
Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1")
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1")
shows error:
Traceback (most recent call last):
File "", line 1, in
File "/transformers/models/auto/auto_factory.py", line 482, in from_pretrained
config, kwargs = AutoConfig.from_pretrained(
File "/transformers/models/auto/configuration_auto.py", line 1022, in from_pretrained
config_class = CONFIG_MAPPING[config_dict["model_type"]]
File "/transformers/models/auto/configuration_auto.py", line 723, in getitem
raise KeyError(key)
KeyError: 'mistral'
What am I missing?
I got the same errors. I think the problem is from API side?
You might have to install it from source , as the associated model code hasn't been released as a new transformers version yet.
pip install git+https://github.com/huggingface/transformers
Hope this helps !
I have the same issue
Hi i was facing same issue, Instead of pip install transformers, as someone stated above earlier use this
!pip install git+https://github.com/huggingface/transformers
Mistral is now part of the official 4.34.0 Transformers release. The above workarounds are not necessary anymore, just make sure to pip install "transformers>=4.34.0"
.