mirror of
https://github.com/m-bain/whisperX.git
synced 2025-07-01 18:17:27 -04:00
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
This commit is contained in:
@ -410,7 +410,7 @@ class WriteJSON(ResultWriter):
|
|||||||
|
|
||||||
def get_writer(
|
def get_writer(
|
||||||
output_format: str, output_dir: str
|
output_format: str, output_dir: str
|
||||||
) -> Callable[[dict, TextIO, dict], None]:
|
) -> Callable[[dict, str, dict], None]:
|
||||||
writers = {
|
writers = {
|
||||||
"txt": WriteTXT,
|
"txt": WriteTXT,
|
||||||
"vtt": WriteVTT,
|
"vtt": WriteVTT,
|
||||||
@ -425,7 +425,7 @@ def get_writer(
|
|||||||
if output_format == "all":
|
if output_format == "all":
|
||||||
all_writers = [writer(output_dir) for writer in writers.values()]
|
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:
|
for writer in all_writers:
|
||||||
writer(result, file, options)
|
writer(result, file, options)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user