[Tests] Fix slow video tensor creation from list of numpy arrays in SmolVLM
Author: Defalt-Meh
Pull request: yes

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

# What does this PR do?
 
While running SmolVLM tests I noticed this warning in the output:
 
```
tests/test_video_processing_common.py:57: UserWarning: Creating a tensor from a list of
numpy.ndarrays is extremely slow. Please consider converting the list to a single
numpy.ndarray with numpy.array() before converting to a tensor.
```
 
Tracked it down to `prepare_video()` in `tests/test_video_processing_common.py` — it builds a list of numpy arrays (one per frame), then passes that list straight to `torch.tensor()`. PyTorch really doesn't like this; it ends up iterating over each array one by one instead of doing a bulk conversion.
 
The fix is simple — consolidate into a single numpy array first, then hand it to torch:
 
```python
# before
video = torch.tensor(video).permute(0, 3, 1, 2)
 
# after
video = torch.from_numpy(np.array(video)).permute(0, 3, 1, 2)
```
 
`np.array()` was already imported. Output is bit-identical (verified with `torch.equal()`), warning is gone.
 
Quick benchmark on Apple M-series, 500 iterations:
 
| Scenario | Before | After | Speedup |
|---|---|---|---|
| What the tests actually use (8 frames, 10x10) | 0.37 ms | 0.002 ms | ~190x |
| More realistic frames (32 frames, 224x224) | 711 ms | 0.06 ms | ~11,000x |
 
All SmolVLM tests pass (302 passed, 186 skipped, 0 failures). No other instances of this pattern in `tests/*.py`.
 
Fixes # (issue)
 
## 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?
- [ ] 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).
- [ ] Did you write any new necessary tests?
 
## Who can review?
 
@yonigozlan @zucchini-nlp

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=44731)
**Latest run:** [29311436569:2](https://github.com/huggingface/transformers/actions/runs/29311436569)
**Result:** `success` | **Jobs:** 15 | **Tests:** 170,983 | **Failures:** 0 | **Duration:** 15h 25m

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

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