Skip to content

Commit

Permalink
clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
boocmp committed Apr 19, 2024
1 parent ee8a98b commit 0ee54b9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/stt_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from fastapi import FastAPI, Request
from fastapi.responses import StreamingResponse
import google_streaming_api_pb2 as speech
import utils.google_streaming.google_streaming_api_pb2 as speech
import bentoml
from utils.npipe import AsyncNamedPipe
import io
Expand Down Expand Up @@ -37,7 +37,6 @@ async def handleUpstream(pair: str, request: Request):

async with await AsyncNamedPipe.create(pair) as pipe:
async for chunk in request.stream():
print(len(chunk))
mic_data += chunk
text = await runner_audio_transcriber.async_run(io.BytesIO(mic_data))
await pipe.write(text["text"] + '\n')
Expand All @@ -50,7 +49,6 @@ async def handleUpstream(pair: str, request: Request):

@app.get("/down")
async def handleDownstream(pair:str):
print("down")
async def handleStream(pair):
try:
async with await AsyncNamedPipe.open(pair) as pipe:
Expand Down

0 comments on commit 0ee54b9

Please sign in to comment.