fix: AttributeError for Qwen3_omni_moe
Author: Vallabh-1504
Pull request: yes
Labels: name: for patch

# What does this PR do?

This PR fixes a crash when initializing `Qwen3OmniMoeTalkerCodePredictorConfig` due to a missing attribute reference.

Specifically, it:
1.  **Removes** the reference to the non-existent `use_sliding_window` attribute, which was causing an `AttributeError`.
2.  **Adds** the missing `max_window_layers` initialization (defaulting to `28`). The existing `layer_types` logic relies on this attribute, and without it, `sliding_window` causes a secondary crash.
3.  **Adds** a new test case (`test_code_predictor_config_init`) to ensure the configuration initializes correctly. 

Fixes #43531


## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case. (Issue #43531)
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?


## Who can review? 


Comments:
cc @vasqu since you commented on the issue!

hi, @vasqu, thanks for the review.
when I was running pytest I was getting an error regarding `max_window_layers`.
This attribute is used in the `layer_types` list comprehension (around line 612).

```
    def __getattribute__(self, key):
        if key != "attribute_map" and key in super().__getattribute__("attribute_map"):
            key = super().__getattribute__("attribute_map")[key]
>       return super().__getattribute__(key)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       AttributeError: 'Qwen3OmniMoeTalkerCodePredictorConfig' object has no attribute 'max_window_layers'

src\transformers\configuration_utils.py:163: AttributeError
```

@Vallabh-1504 hey, any updates on the PR? Would be great to merge it before the next planned release, which I believe should be around this week

hi @zucchini-nlp, I was working on it but hitting a bit of a wall.

I was applying changes through `modular_qwen3_omni_moe.py`, as previously i did manual changes which was wrong. but for some reason, the `modular_model_converter.py` keeps regenerating the `use_sliding_window` logic in the final config, even after i removed it from `modular_qwen3_omni_moe.py`.

kinda stuck in a loop where the generator keeps the code i'm trying to remove.

I also don't know what to do with the `max_window_layers`, as this is also not initialized anywhere.

Can you guide me through this. If i'm missing a step or if there's some cache with the converter?

Smth like this should work, we need to delete unused attributed explicitly and re-assign the "differing" attr. For `max_window_layers`, let's keep it without deleting

https://github.com/Vallabh-1504/transformers/blob/9041720191cdef9348f09f7c1695db606223d353/src/transformers/models/qwen3_omni_moe/modular_qwen3_omni_moe.py#L571-L572

@zucchini-nlp, I have applied the changes as requested!

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_43593). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

**[For maintainers]** Suggested jobs to run (before merge)

run-slow: qwen3_omni_moe