set lang to en if not multilingual

This commit is contained in:
makaveli10
2023-07-31 14:40:38 +08:00
parent caac4ac47b
commit f20c4153d4
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -28,6 +28,7 @@ def recv_audio(websocket):
global clients
options = websocket.recv()
options = json.loads(options)
print(options)
client = ServeClient(
websocket,
multilingual=options["multilingual"],
@@ -55,7 +56,7 @@ class ServeClient:
def __init__(self, websocket, task="transcribe", device=None, multilingual=False, language=None):
self.data = b""
self.frames = b""
self.language = language
self.language = language if multilingual else "en"
self.task = task
self.transcriber = WhisperModel(
"small" if multilingual else "small.en",