# L3 : While loading Qwen model it throws TypeError: argument of type 'NoneType' is not iterable

**URL:** <https://community.deeplearning.ai/t/l3-while-loading-qwen-model-it-throws-typeerror-argument-of-type-nonetype-is-not-iterable/858055>\
**Category:** Post-training of LLMs\
**Created:** [July 23, 2025, 4:37am UTC](https://community.deeplearning.ai/t/l3-while-loading-qwen-model-it-throws-typeerror-argument-of-type-nonetype-is-not-iterable/858055 "2025-07-23T04:37:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bshubh2016](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bshubh2016](https://community.deeplearning.ai/u/bshubh2016)\
**Post date:** [July 23, 2025, 4:37am UTC](https://community.deeplearning.ai/t/l3-while-loading-qwen-model-it-throws-typeerror-argument-of-type-nonetype-is-not-iterable/858055/1 "2025-07-23T04:37:48Z")

</div>

Hello there,

This is regarding L3. I was trying to run the similar setup from ide.  
I have downloaded the Qwen( as mentioned in the course structure) model it the local file system.  
Created the code and applied all the checks for example version of the transformer, trusting remote code and local files only.  
I checked the transformer library version and its

```auto
Transformers version: 4.52.4 

```

However its giving me an error.Its able to load the Tokenizer, however failed in the loading of the model.

```auto
File "\model_train\try_sft_train.py", line 62, in load_model_and_tokenizer
    ret_model = AutoModelForCausalLM.from_pretrained(model_id , trust_remote_code=True, local_files_only=True)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\.venv\Lib\site-packages\transformers\models\auto\auto_factory.py", line 571, in from_pretrained
    return model_class.from_pretrained(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\.venv\Lib\site-packages\transformers\modeling_utils.py", line 309, in _wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "\.venv\Lib\site-packages\transformers\modeling_utils.py", line 4508, in from_pretrained
    model = cls(config, *model_args, **model_kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\.venv\Lib\site-packages\transformers\models\qwen3\modeling_qwen3.py", line 660, in __init__
    self.model = Qwen3Model(config)
                 ^^^^^^^^^^^^^^^^^^
  File "\.venv\Lib\site-packages\transformers\models\qwen3\modeling_qwen3.py", line 389, in __init__
    self.post_init()
  File "\.venv\Lib\site-packages\transformers\modeling_utils.py", line 1969, in post_init
    if v not in ALL_PARALLEL_STYLES:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

```

PS: I have trimmed down the path since it contains sensitive data.

---

<div class="post-metadata">

**Author:** ![bshubh2016](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bshubh2016](https://community.deeplearning.ai/u/bshubh2016)\
**Post date:** [July 23, 2025, 4:45am UTC](https://community.deeplearning.ai/t/l3-while-loading-qwen-model-it-throws-typeerror-argument-of-type-nonetype-is-not-iterable/858055/2 "2025-07-23T04:45:25Z")

</div>

Update:

As a hack I tried to initialize the ALL\_PARALLEL\_STYLES in case its None and it managed to proceed further. 😊

However still I am unable to understand why it failed in my machine and its works in the notebook. 😒

---

<div class="post-metadata">

**Author:** ![yuanlinios](https://avatars.discourse-cdn.com/v4/letter/y/db5fbb/32.png) [@yuanlinios](https://community.deeplearning.ai/u/yuanlinios)\
**Post date:** [May 2, 2026, 4:12am UTC](https://community.deeplearning.ai/t/l3-while-loading-qwen-model-it-throws-typeerror-argument-of-type-nonetype-is-not-iterable/858055/3 "2026-05-02T04:12:31Z")

</div>

transformers==4.52.4 in requirements.txt while the actual notebook runtime uses transformers==4.51.3

---

<div class="post-metadata">

**Author:** ![lesly.zerna](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lesly.zerna/32/47465_2.png) [@lesly.zerna](https://community.deeplearning.ai/u/lesly.zerna)\
**Post date:** [June 30, 2026, 2:58pm UTC](https://community.deeplearning.ai/t/l3-while-loading-qwen-model-it-throws-typeerror-argument-of-type-nonetype-is-not-iterable/858055/4 "2026-06-30T14:58:39Z")

</div>


