KeyError: 'mistral'
Author: brian-bould
Pull request: no

### System Info

System Info
M2 

### Who can help?

_No response_

### Information

- [X] The official example scripts
- [X] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

running on pinokio. 
loading mistralai_Mixtral-8x7B-v0.1 model. 
 error: Traceback (most recent call last):
  File "/Users/bafsr/pinokio/api/oobabooga.pinokio.git/text-generation-webui/modules/ui_model_menu.py", line 209, in load_model_wrapper
    shared.model, shared.tokenizer = load_model(shared.model_name, loader)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bafsr/pinokio/api/oobabooga.pinokio.git/text-generation-webui/modules/models.py", line 88, in load_model
    output = load_func_map[loader](model_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bafsr/pinokio/api/oobabooga.pinokio.git/text-generation-webui/modules/models.py", line 146, in huggingface_loader
    config = AutoConfig.from_pretrained(path_to_model, trust_remote_code=params['trust_remote_code'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bafsr/pinokio/api/oobabooga.pinokio.git/text-generation-webui/installer_files/env/lib/python3.11/site-packages/transformers/models/auto/configuration_auto.py", line 1064, in from_pretrained
    config_class = CONFIG_MAPPING[config_dict["model_type"]]
                   ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bafsr/pinokio/api/oobabooga.pinokio.git/text-generation-webui/installer_files/env/lib/python3.11/site-packages/transformers/models/auto/configuration_auto.py", line 761, in __getitem__
    raise KeyError(key)
KeyError: 'mixtral'

### Expected behavior

run the model 

Comments:
Would it be possible for you to provide the complete code for your reference kindly?

this means you aren't using latest transformers version


Hi @brian-bould, thanks for raising this issue! 

As @ehartford mentions, this is most likely because the transformers version in your environment does not contain the recent mixtral release. Please make sure to follow the [issue template](https://github.com/huggingface/transformers/blob/main/.github/ISSUE_TEMPLATE/bug-report.yml) and fill-out the running environment, including the transformers version. 

This error is unfortunately not super clear. @Rocketknight1 has just merge in a commit - #27976 - which should make the error messages when this occurs clearer. 

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

I still got the same problem using the last transformers version


Hi @kapscudi, that's very unusual! The latest version of `transformers` should recognize the architecture correctly. Can you double-check the version using `import transformers` followed by `transformers.__version__` in `python`? It should be at least `4.36.2`.

I am currently facing the same error when I am loading --model TheBloke_Mistral-7B-OpenOrca-GPTQ --loader ExLlamav2_HF : The current version of `transformers` is 4.37.2 in my environment.

Error: 
```
Started Ooba Booga text generation web UI.
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]: 2024-02-01 18:10:22 INFO:Loading settings from settings.yaml...
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]: 2024-02-01 18:10:22 INFO:Loading TheBloke_Mistral-7B-OpenOrca-GPTQ...
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]: 2024-02-01 18:10:22 INFO:The AutoGPTQ params are: {'model_basename': 'model', 'device': 'cuda:0', 'use_triton': False, 'inject_fused_attention': True, 'inject_fused_mlp': True, 'use_safetensors': True, 'trust_remote_code': False, 'max_memory': None, 'quantize_config': None}
Traceback (most recent call last):
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:   File "/home/kdubey/text-generation-webui/server.py", line 1008, in <module>
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:     shared.model, shared.tokenizer = load_model(shared.model_name)
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:   File "/home/kdubey/text-generation-webui/modules/models.py", line 66, in load_model
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:     output = load_func_map[loader](model_name)
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:   File "/home/kdubey/text-generation-webui/modules/models.py", line 272, in AutoGPTQ_loader
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:     return modules.AutoGPTQ_loader.load_quantized(model_name)
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:   File "/home/kdubey/text-generation-webui/modules/AutoGPTQ_loader.py", line 55, in load_quantized
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:     model = AutoGPTQForCausalLM.from_quantized(path_to_model, **params)
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:   File "/opt/conda/envs/textgen/lib/python3.10/site-packages/auto_gptq/modeling/auto.py", line 79, in from_quantized
 model_type = check_and_get_model_type(save_dir or model_name_or_path, trust_remote_code)
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:   File "/opt/conda/envs/textgen/lib/python3.10/site-packages/auto_gptq/modeling/_utils.py", line 123, in check_and_get_model_type
config = AutoConfig.from_pretrained(model_dir, trust_remote_code=trust_remote_code)
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:   File "/opt/conda/envs/textgen/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 957, in from_pretrained
     config_class = CONFIG_MAPPING[config_dict["model_type"]]
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]:   File "/opt/conda/envs/textgen/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 671, in __getitem__
    raise KeyError(key)
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]: KeyError: 'mistral'
Feb 01 18:10:24 ooba-booga-web-ui conda[14316]: ERROR conda.cli.main_run:execute(49): `conda run python /home/kdubey/text-generation-webui/server.py --listen --listen-port 80 --model TheBloke_Mistral-7B-OpenOrca-GPTQ --loader ExLlamav2_HF --gpu-split 8,10 --api` failed. (See above for error)
bin /opt/conda/envs/textgen/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cuda113_nocublaslt.so
ooba_booga.service: Main process exited, code=exited, status=1/FAILURE
Feb 01 18:10:24 ooba-booga-web-ui systemd[1]: ooba_booga.service: Failed with result 'exit-code'.
```

If you are using ooba-booga-web-ui then the issue should probably be opened on that repo 😉 

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.