File tree 2 files changed +10
-6
lines changed
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
+ import sys
3
4
from typing import TYPE_CHECKING , Any , Optional , cast
4
5
from argparse import ArgumentParser
5
6
@@ -75,7 +76,10 @@ def transcribe(args: CLITranscribeArgs) -> None:
75
76
# but we don't want to validate that here for forwards-compat
76
77
response_format = cast (Any , args .response_format ),
77
78
)
78
- print_model (model )
79
+ if isinstance (model , str ):
80
+ sys .stdout .write (model + "\n " )
81
+ else :
82
+ print_model (model )
79
83
80
84
@staticmethod
81
85
def translate (args : CLITranslationArgs ) -> None :
@@ -91,4 +95,7 @@ def translate(args: CLITranslationArgs) -> None:
91
95
# but we don't want to validate that here for forwards-compat
92
96
response_format = cast (Any , args .response_format ),
93
97
)
94
- print_model (model )
98
+ if isinstance (model , str ):
99
+ sys .stdout .write (model + "\n " )
100
+ else :
101
+ print_model (model )
Original file line number Diff line number Diff line change @@ -33,10 +33,7 @@ def organization_info() -> str:
33
33
34
34
35
35
def print_model (model : BaseModel ) -> None :
36
- if isinstance (model , BaseModel ):
37
- sys .stdout .write (model_json (model , indent = 2 ) + "\n " )
38
- elif isinstance (model , str ):
39
- sys .stdout .write (model )
36
+ sys .stdout .write (model_json (model , indent = 2 ) + "\n " )
40
37
41
38
42
39
def can_use_http2 () -> bool :
You can’t perform that action at this time.
0 commit comments