From c89b4f898f4059b0b78084bbfeea983d235ccfd0 Mon Sep 17 00:00:00 2001 From: JulianFP Date: Tue, 13 May 2025 02:45:33 +0200 Subject: [PATCH] fix: incorrect type annotation in get_writer return value The audio_path attribute that the __call__ method of the ResultWriter class takes is a str, not TextIO --- whisperx/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/whisperx/utils.py b/whisperx/utils.py index dfe3cf2..ada0deb 100644 --- a/whisperx/utils.py +++ b/whisperx/utils.py @@ -410,7 +410,7 @@ class WriteJSON(ResultWriter): def get_writer( output_format: str, output_dir: str -) -> Callable[[dict, TextIO, dict], None]: +) -> Callable[[dict, str, dict], None]: writers = { "txt": WriteTXT, "vtt": WriteVTT, @@ -425,7 +425,7 @@ def get_writer( if output_format == "all": all_writers = [writer(output_dir) for writer in writers.values()] - def write_all(result: dict, file: TextIO, options: dict): + def write_all(result: dict, file: str, options: dict): for writer in all_writers: writer(result, file, options)