Fix Xcodec2 attention to be non-causal.
Author: ebezzam
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=46963)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=46963)
<!-- ci-dashboard-badge:end -->

# What does this PR do?

Fix attention to non-causal.
And some better casting logic.

Here's a script for computing typical codec metrics (STOI, UTMOS) which could be adapted for other codecs: https://gist.github.com/ebezzam/2bd1ae4e602c9281394eddaf0db47640

Below are results, which better match those reported in the [paper](https://arxiv.org/pdf/2502.04128) (last row of Table 1).
```
# after non-causal fix
=== UTMOS v1 + STOI Results (Xcodec2 on LibriSpeech test-clean) ===

  [utmos_v1]
    mean        : 4.126076144207525
    std         : 0.30357224633025415
    min         : 2.1887624263763428
    max         : 4.5252885818481445
    n_samples   : 2620

  [stoi]
    mean        : 0.9185172467513849
    std         : 0.025973485735741188
    min         : 0.7102322578430176
    max         : 0.9643605351448059
    n_samples   : 2620

# before
=== UTMOS v1 + STOI Results (Xcodec2 on LibriSpeech test-clean) ===

  [utmos_v1]
    mean        : 3.3033667397408086
    std         : 0.4488575984272713
    min         : 1.3538525104522705
    max         : 4.418213367462158
    n_samples   : 2620

  [stoi]
    mean        : 0.8875954491719035
    std         : 0.030786942237932484
    min         : 0.6717123985290527
    max         : 0.9476659893989563
    n_samples   : 2620
```

<!-- 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=46963)
**Latest run:** [28383088506](https://github.com/huggingface/transformers/actions/runs/28383088506)
**Result:** `success` | Grafana metrics are not available yet.

<!-- ci-dashboard-recap:end -->

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

run-slow: xcodec2

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

run-slow: xcodec2

[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/28384067768)

This comment contains `run-slow`, running the specified jobs: 

models: ["models/xcodec2"]
quantizations: []

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/28384067768)

### Commit Info
| Context | Commit | Description |
|---------|--------|-------------|
| RUN | [2fcd9b6b](https://github.com/huggingface/transformers/commit/2fcd9b6b3cfa203800c12c03459c3ef4408d80d3) | workflow commit (merge commit) |
| PR | [a07df235](https://github.com/ebezzam/transformers/commit/a07df23536e0682389dfcf0abbe799b0a0b1c736) | branch commit (from PR) |
| main | [fdb6d318](https://github.com/huggingface/transformers/commit/fdb6d318138c10ad29ac750388917808f50c867c) | base commit (on `main`) |

✅ No failing test specific to this PR 🎉 👏 !