mirror of
https://github.com/shirayu/whispering.git
synced 2024-11-25 10:21:00 +00:00
Fix
This commit is contained in:
parent
936d5d0c45
commit
847eee5819
1 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ async def serve_with_websocket_main(websocket):
|
|||
)
|
||||
|
||||
while True:
|
||||
logger.debug(f"Segment #: {idx}")
|
||||
logger.debug(f"Audio #: {idx}")
|
||||
try:
|
||||
message = await websocket.recv()
|
||||
except ConnectionClosedOK:
|
||||
|
@ -32,9 +32,9 @@ async def serve_with_websocket_main(websocket):
|
|||
continue
|
||||
|
||||
logger.debug(f"Message size: {len(message)}")
|
||||
segment = np.frombuffer(message, dtype=np.float32)
|
||||
audio = np.frombuffer(message, dtype=np.float32)
|
||||
for chunk in g_wsp.transcribe(
|
||||
segment=segment, # type: ignore
|
||||
audio=audio, # type: ignore
|
||||
ctx=ctx,
|
||||
):
|
||||
await websocket.send(chunk.json())
|
||||
|
|
Loading…
Reference in a new issue