mirror of
https://github.com/shirayu/whispering.git
synced 2024-06-13 02:39:23 +00:00
Fix CI
This commit is contained in:
parent
5f777d69f7
commit
7c20da4793
|
@ -16,7 +16,7 @@ from whisper.audio import N_FRAMES, SAMPLE_RATE
|
|||
from whisper.tokenizer import LANGUAGES, TO_LANGUAGE_CODE
|
||||
|
||||
from whispering.pbar import ProgressBar
|
||||
from whispering.schema import Context, WhisperConfig, StdoutWriter
|
||||
from whispering.schema import Context, StdoutWriter, WhisperConfig
|
||||
from whispering.serve import serve_with_websocket
|
||||
from whispering.transcriber import WhisperStreamingTranscriber
|
||||
from whispering.websocket_client import run_websocket_client
|
||||
|
@ -106,7 +106,8 @@ def get_opts() -> argparse.Namespace:
|
|||
"--language",
|
||||
type=str,
|
||||
default=None,
|
||||
choices=["multilanguage"] + sorted(LANGUAGES.keys())
|
||||
choices=["multilanguage"]
|
||||
+ sorted(LANGUAGES.keys())
|
||||
+ sorted([k.title() for k in TO_LANGUAGE_CODE.keys()]),
|
||||
)
|
||||
group_model.add_argument(
|
||||
|
|
|
@ -18,6 +18,7 @@ async def serve_with_websocket_main(websocket):
|
|||
global g_wsp
|
||||
idx: int = 0
|
||||
ctx: Optional[Context] = None
|
||||
|
||||
while True:
|
||||
logger.debug(f"Audio #: {idx}")
|
||||
try:
|
||||
|
@ -77,7 +78,7 @@ async def serve_with_websocket(
|
|||
serve_with_websocket_main,
|
||||
host=host,
|
||||
port=port,
|
||||
max_size=999999999
|
||||
max_size=999999999,
|
||||
):
|
||||
await asyncio.Future()
|
||||
except KeyboardInterrupt:
|
||||
|
|
|
@ -49,7 +49,7 @@ class WhisperStreamingTranscriber:
|
|||
task="transcribe",
|
||||
)
|
||||
# Mulilanguage transcripts
|
||||
else:
|
||||
else:
|
||||
self.tokenizer = get_tokenizer(
|
||||
self.model.is_multilingual,
|
||||
task="transcribe",
|
||||
|
@ -132,6 +132,7 @@ class WhisperStreamingTranscriber:
|
|||
_decode_options,
|
||||
) # type: ignore
|
||||
assert decode_result is not None
|
||||
|
||||
needs_fallback: bool = False
|
||||
if (
|
||||
ctx.compression_ratio_threshold is not None
|
||||
|
|
Loading…
Reference in a new issue