# Transformers Pretrained model import

**URL:** <https://discuss.huggingface.co/t/transformers-pretrained-model-import/129946>\
**Category:** 🤗Transformers\
**Created:** [December 8, 2024, 9:20am UTC](https://discuss.huggingface.co/t/transformers-pretrained-model-import/129946 "2024-12-08T09:20:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spencer1129](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/spencer1129/32/37005_2.png) [@spencer1129](https://discuss.huggingface.co/u/spencer1129)\
**Post date:** [December 8, 2024, 9:20am UTC](https://discuss.huggingface.co/t/transformers-pretrained-model-import/129946/1 "2024-12-08T09:20:59Z")

</div>

My Transformers version is 4.45.0.  
I loaded facebook/opt350m like this:

```auto
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model = AutoModelForCausalLM.from_pretrained("facebook/opt-350m").to(device)

```

But error happened.  
RuntimeError: Failed to import transformers.models.glm.configuration\_glm because of the following error (look up to see its traceback):  
No module named ‘transformers.models.glm.configuration\_glm’  
Help me!

---

<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:** [December 8, 2024, 10:21am UTC](https://discuss.huggingface.co/t/transformers-pretrained-model-import/129946/2 "2024-12-08T10:21:22Z")

</div>

That class was updated two weeks ago, so it would be better to update transformers. If you want to use the github version, follow the instructions below.

```auto
pip install -U transformers

```

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

```

---

<div class="post-metadata">

**Author:** ![spencer1129](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/spencer1129/32/37005_2.png) [@spencer1129](https://discuss.huggingface.co/u/spencer1129)\
**Post date:** [December 8, 2024, 12:01pm UTC](https://discuss.huggingface.co/t/transformers-pretrained-model-import/129946/3 "2024-12-08T12:01:23Z")

</div>

Thank You!

You are always great helper!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](https://discuss.huggingface.co/u/system)\
**Post date:** [December 9, 2024, 12:01am UTC](https://discuss.huggingface.co/t/transformers-pretrained-model-import/129946/4 "2024-12-09T00:01:47Z")

</div>

Closed on December 9, 2024, 12:01am UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
