Add support for Quatfit1 multimodal models
Author: Jatinverma0786
Pull request: yes

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

# Add native support for the Quatfit1 multimodal architecture

## Summary

This pull request adds native support for **Quatfit1**, a multimodal architecture derived from Gemma4, to the Transformers library.

Quatfit1 introduces a dedicated `model_type` (`quatfit1`) while leveraging the existing Gemma4 implementation. Native integration allows Quatfit models to be loaded directly through the Transformers Auto Classes without requiring `trust_remote_code=True`.

---

## Motivation

Currently, Quatfit models require remote code execution to be loaded:

```python
from transformers import AutoModelForImageTextToText

model = AutoModelForImageTextToText.from_pretrained(
    "Quatfit/Quatfit-Mini",
    trust_remote_code=True,
)
```

With native Transformers support, users can simply write:

```python
from transformers import AutoModelForImageTextToText

model = AutoModelForImageTextToText.from_pretrained(
    "Quatfit/Quatfit-Mini"
)
```

This improves interoperability with the Hugging Face ecosystem and provides a more seamless user experience.

---

## Features

Quatfit1 supports:

- Text generation
- Image understanding
- Audio understanding
- Video understanding
- Multimodal instruction following
- Long-context inference
- Hugging Face Auto Classes

---

## Architecture

Quatfit1 is implemented as a Gemma4-derived architecture with its own configuration classes.

The following classes are introduced:

- `Quatfit1Config`
- `Quatfit1TextConfig`
- `Quatfit1VisionConfig`
- `Quatfit1AudioConfig`
- `Quatfit1ForConditionalGeneration`

The architecture defines:

```python
model_type = "quatfit1"
```

while remaining compatible with the existing Gemma4 tokenizer and processor.

---

## Files Added

```
src/transformers/models/quatfit1/
├── __init__.py
├── configuration_quatfit1.py
└── modeling_quatfit1.py
```

---

## Auto Class Support

This PR registers Quatfit1 for:

- `AutoConfig`
- `AutoModel`
- `AutoModelForCausalLM`
- `AutoModelForImageTextToText`

allowing native loading through the Transformers Auto Classes.

---

## Example Usage

### Text

```python
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("Quatfit/Quatfit-Mini")

model = AutoModelForCausalLM.from_pretrained(
    "Quatfit/Quatfit-Mini"
)
```

### Multimodal

```python
from transformers import AutoProcessor
from transformers import AutoModelForImageTextToText

processor = AutoProcessor.from_pretrained("Quatfit/Quatfit-Mini")

model = AutoModelForImageTextToText.from_pretrained(
    "Quatfit/Quatfit-Mini"
)
```

---

## Compatibility

Quatfit1 is compatible with:

- Hugging Face Hub
- AutoConfig
- AutoModel
- AutoModelForCausalLM
- AutoModelForImageTextToText
- Accelerate
- Safetensors
- Device Mapping
- Generation API

---

## Backward Compatibility

This PR introduces a new architecture without modifying the behavior of existing Gemma4 models.

Existing Gemma4 checkpoints continue to function as before.

---

## Checklist

- [x] Added Quatfit1 configuration
- [x] Added Quatfit1 model implementation
- [x] Registered AutoConfig
- [x] Registered AutoModel
- [x] Registered AutoModelForCausalLM
- [x] Registered AutoModelForImageTextToText
- [x] Added Quatfit1 configuration mappings
- [x] Verified model loading
- [x] Verified inference

Comments:
<!-- 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=47080)
**Latest run:** [28728614248:2](https://github.com/huggingface/transformers/actions/runs/28728614248)
**Result:** `failure` | **Jobs:** 2 | **Tests:** 6 | **Failures:** 1 | **Duration:** 36s

> **Code quality check failed**: test jobs were skipped. Fix the code quality issues and push again to run tests.

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