| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | import pytest |
| 4 | |
| 5 | from vllm.assets.audio import AudioAsset |
| 6 | |
| 7 | |
| 8 | def add_attention_backend(server_args, attention_config): |
| 9 | """Append attention backend CLI arg if specified. |
| 10 | |
| 11 | Args: |
| 12 | server_args: List of server arguments to extend in-place. |
| 13 | attention_config: Dict with 'backend' key, or None. |
| 14 | |
| 15 | """ |
| 16 | if attention_config and "backend" in attention_config: |
| 17 | server_args.extend(["--attention-backend", attention_config["backend"]]) |
| 18 | |
| 19 | |
| 20 | @pytest.fixture |
| 21 | def mary_had_lamb(): |
| 22 | path = AudioAsset("mary_had_lamb").get_local_path() |
| 23 | with open(str(path), "rb") as f: |
| 24 | yield f |
| 25 | |
| 26 | |
| 27 | @pytest.fixture |
| 28 | def winning_call(): |
| 29 | path = AudioAsset("winning_call").get_local_path() |
| 30 | with open(str(path), "rb") as f: |
| 31 | yield f |
| 32 | |
| 33 | |
| 34 | @pytest.fixture |
| 35 | def foscolo(): |
| 36 | # Test translation it->en |
| 37 | path = AudioAsset("azacinto_foscolo").get_local_path() |
| 38 | with open(str(path), "rb") as f: |
| 39 | yield f |