Add Gemma4Unified sequence classification
Author: yuvrajsharma9981
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=46966)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=46966)
<!-- ci-dashboard-badge:end -->

# Add `Gemma4Unified` sequence classification

## What does this PR do?

Adds sequence-classification heads to the `gemma4_unified` model:

- **`Gemma4UnifiedForSequenceClassification`** — multimodal (built on `Gemma4UnifiedModel`)
- **`Gemma4UnifiedTextForSequenceClassification`** — text-only (built on `Gemma4UnifiedTextModel`)

`transformers` ships the `gemma4_unified` backbone and its causal-LM / conditional-generation
heads, but no sequence-classification head, so the model can't be loaded via
`AutoModelForSequenceClassification`. This fills that gap, mirroring the existing **Gemma3**
sequence-classification heads (`Gemma3ForSequenceClassification` / `Gemma3TextForSequenceClassification`),
which are the closest structural analog.

### Implementation

- Both heads reuse `GenericForSequenceClassification` (last-non-pad-token pooling → `score` Linear),
  matching how Gemma3 and the other recent decoder-only classifiers are implemented.
- Added in the modular file (`modular_gemma4_unified.py`) and the modeling file regenerated via the
  modular converter. The text head is the minimal `GenericForSequenceClassification` subclass; the
  multimodal head overrides `forward` to thread `gemma4_unified`'s multimodal kwargs
  (`pixel_values`, `pixel_values_videos`, `input_features`, `input_features_mask`,
  `mm_token_type_ids`, `image_position_ids`, `video_position_ids`).
- Registered in `MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES` for both the `gemma4_unified` and
  `gemma4_unified_text` model types.
- Docs: added autodoc entries for both classes.
- Tests: text head via `CausalLMModelTester.sequence_classification_class`; multimodal head added to
  `Gemma4UnifiedVision2TextModelTest.all_model_classes`.

### Checks run locally

- `python utils/modular_model_converter.py --files_to_parse .../modular_gemma4_unified.py` — modeling
  file regenerates identically (modular in sync).
- `python utils/check_repo.py` — passes (both classes documented + tested).
- `pytest tests/models/gemma4_unified/test_modeling_gemma4_unified.py -k sequence_class` — text-head
  seq-cls tests pass (`single_label`, `multi_label`, base); multimodal head passes the generic
  `ModelTesterMixin` suite.
- Sanity-loaded `google/gemma-4-12B-it` as `AutoModelForSequenceClassification` (num_labels=250):
  only the fresh `score.weight` is reported missing (all backbone weights load), logits shape correct.

## Before submitting

- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request)?
- [x] Was this discussed/approved via a GitHub issue or the [forum](https://discuss.huggingface.co/)? — small additive feature mirroring an existing model
- [x] Did you make sure to update the documentation with your changes?
- [x] Did you write any new necessary tests?

## Who can review?

@ArthurZucker @Cyrilvallez (text + Gemma models)

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

run-slow: auto, gemma4_unified

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=46966)
**Latest run:** [28473044660:2](https://github.com/huggingface/transformers/actions/runs/28473044660)
**Result:** `failure` | **Jobs:** 14 | **Tests:** 67,081 | **Failures:** 0 | **Duration:** 18h 19m

<!-- ci-dashboard-recap:end -->

There are no checkpoints for those models, so unless required by several humans and no bots, no point in merging this!