feat: Add GGUF loading support for Llama 4 (text)
Author: garybadwal
Pull request: yes

# What does this PR do?

Fixes #33260 

Adds GGUF loading support for the **Llama 4** text backbone (`llama4_text`), the last major Llama-family architecture that still raised `GGUF model with architecture llama4 is not supported yet.` Users can now do:

```python
AutoModelForCausalLM.from_pretrained(
    "unsloth/Llama-4-Scout-17B-16E-Instruct-GGUF",
    gguf_file="Llama-4-Scout-17B-16E-Instruct-Q2_K_L.gguf",
)
```
Scope is text-only, matches what llama.cpp's convert_hf_to_gguf.py emits for Llama 4 (vision tensors are skipped there), and is consistent with the existing gemma3_text GGUF path.

## Code Agent Policy

The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. We are currently bottlenecked by our ability to review and respond to them. As a result, 
**we ask that new users do not submit pure code agent PRs** at this time. 
You may use code agents in drafting or to help you diagnose issues. We'd also ask autonomous "OpenClaw"-like agents
not to open any PRs or issues for the moment.

PRs that appear to be fully agent-written will probably be closed without review, and we may block users who do this
repeatedly or maliciously. 

This is a rapidly-evolving situation that's causing significant shockwaves in the open-source community. As a result, 
this policy is likely to be updated regularly in the near future. For more information, please read [`CONTRIBUTING.md`](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md).

- [x] I confirm that this is not a pure code agent PR.

## Before submitting
- [ ] 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.
- [ ] 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?

@SunMarc  — you own #33260 and the GGUF loader; would appreciate your review.
cc @MekkCyber @Isotr0py — you weighed in on #36144 (DeepSeek GGUF) and have context on the GGUF MoE pipeline.
cc @ArthurZucker — as maintainer of the Llama 4 text model in case anything about the MoE / tokenizer path looks off.

Comments:
Thanks @SunMarc, I'll check these and add more strong test case in this.

Again thank you for your precision time. 🫡

Hey @SunMarc, thanks for the feedback! I've addressed all three comments:

- Removed `test_llama4_config_mapping` and `test_llama4_architecture_mapping` as suggested.
- Added a proper `test_llama4_q2_k_l_tokenizer` test that saves/reloads the tokenizer and validates round-trip encoding.
- Updated `test_llama4_q2_k_l` to assert against an exact `EXPECTED_TEXT` string instead of the weak length check.

Regarding the CI failure, it's in `GlmImageModelTest::test_sample_generate_dict_output` which is a pre-existing tensor size mismatch in `modeling_glm_image.py`. 

My PR only touches ggml.py, `modeling_gguf_pytorch_utils.py`, and the GGUF test file, so this failure is unrelated to my changes. But if there is anything that I can do about this please let me know.

Hi @SunMarc can you review the PR once again ? I made the changes you requested.

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

run-slow: ggml

Hi @SunMarc, just wanted to check with you if you got time to look into this PR, I made the changes you requested.

@ArthurZucker is currently working on a refactor of gguf integration. So i would like to wait a bit before proceeding with this PR ! https://github.com/huggingface/transformers/pull/44794

> @ArthurZucker is currently working on a refactor of gguf integration. So i would like to wait a bit before proceeding with this PR ! #44794

No problem @SunMarc, just let me know whenever you want me to make changes of required in this PR.

Thank you for your reply 🫡 

Hi @SunMarc, just wanted to check with you if this PR is good to go or there is something you want me to make changes in?