Skip to content

Commit

Permalink
fix/valid_langs_arg
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Nov 24, 2024
1 parent d73eedc commit 4514726
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ovos_stt_http_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ async def get_stt(request: Request):
@app.post("/lang_detect")
async def get_lang(request: Request):
valid = request.query_params.get("valid_langs").split(",")
if len(valid) == 1:
return {"lang": valid[0], "conf": 1.0}
audio_bytes = await request.body()
lang, prob = model.detect_language(audio_bytes, valid_langs=valid)
return {"lang": lang, "conf": prob}
Expand Down

0 comments on commit 4514726

Please sign in to comment.