mirror of
https://github.com/openai/whisper.git
synced 2025-11-24 14:35:57 +00:00
get writer before loading model
in case the user inputs unsupported output format
This commit is contained in:
parent
de14ad8729
commit
dc6036eab8
@ -555,6 +555,7 @@ def cli():
|
|||||||
output_format: str = args.pop("output_format")
|
output_format: str = args.pop("output_format")
|
||||||
device: str = args.pop("device")
|
device: str = args.pop("device")
|
||||||
os.makedirs(output_dir, exist_ok=True)
|
os.makedirs(output_dir, exist_ok=True)
|
||||||
|
writer = get_writer(output_format, output_dir)
|
||||||
|
|
||||||
if model_name.endswith(".en") and args["language"] not in {"en", "English"}:
|
if model_name.endswith(".en") and args["language"] not in {"en", "English"}:
|
||||||
if args["language"] is not None:
|
if args["language"] is not None:
|
||||||
@ -576,7 +577,6 @@ def cli():
|
|||||||
|
|
||||||
model = load_model(model_name, device=device, download_root=model_dir)
|
model = load_model(model_name, device=device, download_root=model_dir)
|
||||||
|
|
||||||
writer = get_writer(output_format, output_dir)
|
|
||||||
word_options = [
|
word_options = [
|
||||||
"highlight_words",
|
"highlight_words",
|
||||||
"max_line_count",
|
"max_line_count",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user