From ede1d61587e31466a54161f205b19c9f1d12de65 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Wed, 15 Nov 2023 16:20:01 +0800 Subject: [PATCH] add: /konele/status --- requirements.txt | 2 +- whisper_fastapi.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f89445c..420eaf5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ python-multipart fastapi -uvicorn +uvicorn[standard] whisper_ctranslate2 opencc prometheus-fastapi-instrumentator diff --git a/whisper_fastapi.py b/whisper_fastapi.py index e058ba6..0575368 100644 --- a/whisper_fastapi.py +++ b/whisper_fastapi.py @@ -109,6 +109,15 @@ def get_options(*, initial_prompt=""): return options +@app.websocket("/konele/status") +async def konele_status( + websocket: WebSocket, +): + await websocket.accept() + await websocket.send_json(dict(num_workers_available=1)) + await websocket.close() + + @app.websocket("/konele/ws") async def konele_ws( websocket: WebSocket,