Skip to content

Commit

Permalink
LOG.set_level("ERROR") # avoid server side logs
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Oct 14, 2023
1 parent add03f1 commit d5ae999
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ovos_stt_http_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
from starlette.requests import Request


LOG.set_level("ERROR") # avoid server side logs


class ModelContainer:
def __init__(self, plugin: str, config: dict=None):
self.plugin = load_stt_plugin(plugin)
Expand Down Expand Up @@ -100,10 +103,8 @@ def stats(request: Request):

@app.post("/stt")
async def get_stt(request: Request):
LOG.debug(f"Handling STT Request: {request}")
lang = str(request.query_params.get("lang", "en-us")).lower()
audio_bytes = await request.body()
LOG.debug(len(audio_bytes))
audio = bytes2audiodata(audio_bytes)
return model.process_audio(audio, lang)

Expand All @@ -130,7 +131,6 @@ def stream_end(request: Request):
uuid = str(request.query_params.get("uuid") or lang)
# model.wait_until_done(uuid)
transcript = model.stream_stop(uuid)
LOG.info(transcript)
return {"status": "ok", "uuid": uuid,
"lang": lang, "transcript": transcript}

Expand Down

0 comments on commit d5ae999

Please sign in to comment.