# ValueError in deploying HuggingFace Model to Sagemanker with Multiple Lora Adapters

**URL:** <https://discuss.huggingface.co/t/valueerror-in-deploying-huggingface-model-to-sagemanker-with-multiple-lora-adapters/113199>\
**Category:** Beginners\
**Created:** [October 21, 2024, 3:20pm UTC](https://discuss.huggingface.co/t/valueerror-in-deploying-huggingface-model-to-sagemanker-with-multiple-lora-adapters/113199 "2024-10-21T15:20:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruchika1809](https://avatars.discourse-cdn.com/v4/letter/r/7ab992/32.png) [@Ruchika1809](https://discuss.huggingface.co/u/Ruchika1809)\
**Post date:** [October 21, 2024, 3:20pm UTC](https://discuss.huggingface.co/t/valueerror-in-deploying-huggingface-model-to-sagemanker-with-multiple-lora-adapters/113199/1 "2024-10-21T15:20:05Z")

</div>

I am getting below ValueError in deploying HuggingFace Model to Sagemanker with Multiple LoRA Adapters

ValueError: The checkpoint you are trying to load has model type `starcoder2` but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.

Let me know if anyone has faced this earlier

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 21, 2024, 10:24pm UTC](https://discuss.huggingface.co/t/valueerror-in-deploying-huggingface-model-to-sagemanker-with-multiple-lora-adapters/113199/2 "2024-10-21T22:24:57Z")

</div>

Maybe this issue.

> <https://github.com/bigcode-project/starcoder2/issues/12>
>
> \#Facing the following error while trying to finetune Starcoder2 with the given s…cript. 
> 
> \### Description:
> For \`transformers.AutoModelForCausalLM\` to recognize Starcoder2 \`transformers\>4.39.0\` is required.
> 
> But \`trl\` is still using \`transformers==4.38.2\`. Even if I compile from source & use \`trl=0.7.12.dev0\` I still get an issue.
> 
> 
> \## Here is the error with using \`transformers==4.38.2\`
> 
> \`\`\`
> KeyError Traceback (most recent call last)
> \[/usr/local/lib/python3.10/dist-packages/transformers/models/auto/configuration\_auto.py\](https://localhost:8080/#) in from\_pretrained(cls, pretrained\_model\_name\_or\_path, \*\*kwargs)
> 1127 try:
> \-\> 1128 config\_class = CONFIG\_MAPPING\[config\_dict\["model\_type"\]\]
> 1129 except KeyError:
> 
> 4 frames
> KeyError: 'starcoder2'
> 
> During handling of the above exception, another exception occurred:
> 
> ValueError Traceback (most recent call last)
> \[/usr/local/lib/python3.10/dist-packages/transformers/models/auto/configuration\_auto.py\](https://localhost:8080/#) in from\_pretrained(cls, pretrained\_model\_name\_or\_path, \*\*kwargs)
> 1128 config\_class = CONFIG\_MAPPING\[config\_dict\["model\_type"\]\]
> 1129 except KeyError:
> \-\> 1130 raise ValueError(
> 1131 f"The checkpoint you are trying to load has model type \`{config\_dict\['model\_type'\]}\` "
> 1132 "but Transformers does not recognize this architecture. This could be because of an "
> 
> ValueError: The checkpoint you are trying to load has model type \`starcoder2\` but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date. 
> \`\`\`
> 
> \## Here is the error when using \`transformers==4.39.0\`
> 
> \`\`\`
> ImportError Traceback (most recent call last)
> \[\<ipython-input-2-3ef713ffd06d\>\](https://localhost:8080/#) in \<cell line: 1\>()
> \----\> 1 from trl import SFTTrainer
> 2 print("trl version:", trl.\_\_version\_\_)
> 
> 1 frames
> \[/usr/local/lib/python3.10/dist-packages/trl/\_\_init\_\_.py\](https://localhost:8080/#) in \<module\>
> 3 \_\_version\_\_ = "0.7.12.dev0"
> 4 
> \----\> 5 from .core import set\_seed
> 6 from .environment import TextEnvironment, TextHistory
> 7 from .extras import BestOfNSampler
> 
> \[/usr/local/lib/python3.10/dist-packages/trl/core.py\](https://localhost:8080/#) in \<module\>
> 23 import torch.nn.functional as F
> 24 from torch.nn.utils.rnn import pad\_sequence
> \---\> 25 from transformers import top\_k\_top\_p\_filtering
> 26 
> 27 from .import\_utils import is\_npu\_available, is\_xpu\_available
> 
> ImportError: cannot import name 'top\_k\_top\_p\_filtering' from 'transformers' (/usr/local/lib/python3.10/dist-packages/transformers/\_\_init\_\_.py)
> 
> \---------------------------------------------------------------------------
> NOTE: If your import is failing due to a missing package, you can
> manually install dependencies using either !pip or !apt.
> 
> To view examples of installing some common dependencies, click the
> "Open Examples" button below.
> \---------------------------------------------------------------------------
> \`\`\`
