# Transformers Pretrained model import

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformers-pretrained-model-import%2F129946%3E%5C
**Category:** 🤗Transformers\
**Created:** [December 8, 2024, 9:20am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformers-pretrained-model-import%2F129946 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fspencer1129)%5C
**Post date:** [December 8, 2024, 9:20am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformers-pretrained-model-import%2F129946%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [December 8, 2024, 10:21am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformers-pretrained-model-import%2F129946%2F2 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fspencer1129)%5C
**Post date:** [December 8, 2024, 12:01pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformers-pretrained-model-import%2F129946%2F3 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsystem)%5C
**Post date:** [December 9, 2024, 12:01am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformers-pretrained-model-import%2F129946%2F4 "2024-12-09T00:01:47Z")

</div>

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