# I'm having an issue with the mistral-instruct model

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fim-having-an-issue-with-the-mistral-instruct-model%2F57154%3E%5C
**Category:** Models\
**Created:** [October 2, 2023, 9:36pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fim-having-an-issue-with-the-mistral-instruct-model%2F57154 "2023-10-02T21:36:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rexe](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/rexe/32/34135_2.png) [@Rexe](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FRexe)%5C
**Post date:** [October 2, 2023, 9:36pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fim-having-an-issue-with-the-mistral-instruct-model%2F57154%2F1 "2023-10-02T21:36:06Z")

</div>

* * *

KeyError Traceback (most recent call last)  
Cell In[6], line 12  
10 model\_id = “mistralai/Mistral-7B-Instruct-v0.1”  
11 # Load the model configuration  
—\> 12 config = AutoConfig.from\_pretrained(model\_id)  
13 config.naive\_attention\_prefill = True  
15 bnb\_config = BitsAndBytesConfig(  
16 load\_in\_4bit=True,  
17 bnb\_4bit\_use\_double\_quant=True,  
18 bnb\_4bit\_quant\_type=“nf4”,  
19 bnb\_4bit\_compute\_dtype=torch.bfloat16  
20 )

File /opt/conda/lib/python3.10/site-packages/transformers/models/auto/configuration\_auto.py:1041, in AutoConfig.from\_pretrained(cls, pretrained\_model\_name\_or\_path, \*\*kwargs)  
1039 return config\_class.from\_pretrained(pretrained\_model\_name\_or\_path, \*\*kwargs)  
1040 elif “model\_type” in config\_dict:  
 → 1041 config\_class = CONFIG\_MAPPING[config\_dict[“model\_type”]]  
1042 return config\_class.from\_dict(config\_dict, \*\*unused\_kwargs)  
1043 else:  
1044 # Fallback: use pattern matching on the string.  
1045 # We go from longer names to shorter names to catch roberta before bert (for instance)

File /opt/conda/lib/python3.10/site-packages/transformers/models/auto/configuration\_auto.py:734, in \_LazyConfigMapping. **getitem** (self, key)  
732 return self.\_extra\_content[key]  
733 if key not in self.\_mapping:  
 → 734 raise KeyError(key)  
735 value = self.\_mapping[key]  
736 module\_name = model\_type\_to\_module\_name(key)

KeyError: ‘mistral’

---

<div class="post-metadata">

**Author:** ![rschrem](https://avatars.discourse-cdn.com/v4/letter/r/ed655f/32.png) [@rschrem](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Frschrem)%5C
**Post date:** [October 3, 2023, 2:18pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fim-having-an-issue-with-the-mistral-instruct-model%2F57154%2F2 "2023-10-03T14:18:12Z")

</div>

Installing transformers from source helps -

```auto
pip install --upgrade git+https://github.com/huggingface/transformers

```

---

<div class="post-metadata">

**Author:** ![Manu9000k](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@Manu9000k](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FManu9000k)%5C
**Post date:** [October 4, 2023, 5:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fim-having-an-issue-with-the-mistral-instruct-model%2F57154%2F3 "2023-10-04T17:45:27Z")

</div>

I have the same error but even installing transformers I get the same error

---

<div class="post-metadata">

**Author:** ![Kanishka28](https://avatars.discourse-cdn.com/v4/letter/k/b5a626/32.png) [@Kanishka28](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FKanishka28)%5C
**Post date:** [February 1, 2024, 7:03pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fim-having-an-issue-with-the-mistral-instruct-model%2F57154%2F4 "2024-02-01T19:03:16Z")

</div>

same here, were you able to solve it??

---

<div class="post-metadata">

**Author:** ![sherbadshah](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@sherbadshah](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsherbadshah)%5C
**Post date:** [February 8, 2024, 11:21pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fim-having-an-issue-with-the-mistral-instruct-model%2F57154%2F5 "2024-02-08T23:21:21Z")

</div>

I found this solve the issue:

pip install --upgrade transformers
