From bbbb8cceb660d2f5def793a238e98b906ce8ccd1 Mon Sep 17 00:00:00 2001 From: NickLucche Date: Fri, 14 Feb 2025 15:29:18 +0000 Subject: [PATCH] mypy Signed-off-by: NickLucche --- vllm/entrypoints/whisper_server/api_server.py | 2 +- vllm/entrypoints/whisper_server/helper.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vllm/entrypoints/whisper_server/api_server.py b/vllm/entrypoints/whisper_server/api_server.py index 5b93461b3cfc1..59c7dd0ca4662 100644 --- a/vllm/entrypoints/whisper_server/api_server.py +++ b/vllm/entrypoints/whisper_server/api_server.py @@ -112,7 +112,7 @@ async def _generate(prompt, raw_request: Request) -> Response: engine = raw_request.app.state.engine results_generator = engine.generate(prompt, sampling_params, request_id) - async def stream_results() -> AsyncGenerator[bytes, None]: + async def stream_results() -> AsyncGenerator[str, None]: async for request_output in results_generator: assert len(request_output.outputs) == 1 chunk = TranscriptionResponse(text=request_output.outputs[0].text) diff --git a/vllm/entrypoints/whisper_server/helper.py b/vllm/entrypoints/whisper_server/helper.py index aaf3674f24e03..c12ce809b4305 100644 --- a/vllm/entrypoints/whisper_server/helper.py +++ b/vllm/entrypoints/whisper_server/helper.py @@ -28,7 +28,7 @@ def exact_div(x, y): N_SAMPLES_PER_TOKEN) # 20ms per audio token -def load_audio_from_bytes(audio_bytes: str, sample_rate: int = SAMPLE_RATE): +def load_audio_from_bytes(audio_bytes: bytes, sample_rate: int = SAMPLE_RATE): """ Read bytes from audio file as mono waveform, resampling as necessary