From 7cc945aded8fa90c32f1f4229c767400e991e191 Mon Sep 17 00:00:00 2001 From: Sasa Trivic Date: Wed, 31 Jan 2024 16:45:31 +0100 Subject: [PATCH 1/6] self.client_uid accessed without being defined --- whisper_live/server.py | 1 + 1 file changed, 1 insertion(+) diff --git a/whisper_live/server.py b/whisper_live/server.py index be0e9598..5a5b08ec 100644 --- a/whisper_live/server.py +++ b/whisper_live/server.py @@ -136,6 +136,7 @@ def recv_audio(self, ) logging.info(f"Running TensorRT backend.") except Exception as e: + self.client_uid = options["uid"] websocket.send( json.dumps( { From 82002075304b920ca708b8fcae26b9342cbee77f Mon Sep 17 00:00:00 2001 From: Sasa Trivic Date: Thu, 1 Feb 2024 13:16:23 +0100 Subject: [PATCH 2/6] Center transcription div --- Audio-Transcription-Chrome/content.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Audio-Transcription-Chrome/content.js b/Audio-Transcription-Chrome/content.js index 1c89a2a8..3c911e48 100644 --- a/Audio-Transcription-Chrome/content.js +++ b/Audio-Transcription-Chrome/content.js @@ -59,7 +59,7 @@ function init_element() { elem_container = document.createElement('div'); elem_container.id = "transcription"; - elem_container.style.cssText = 'padding-top:16px;font-size:18px;line-height:18px;top:0px;position:absolute;width:500px;height:90px;opacity:0.9;z-index:100;background:black;border-radius:10px;color:white;'; + elem_container.style.cssText = 'padding-top:16px;font-size:18px;position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);z-index: 9999;line-height:18px;width:500px;height:90px;opacity:0.9;z-index:100;background:black;border-radius:10px;color:white;'; for (var i = 0; i < 4; i++) { elem_text = document.createElement('span'); From e1f531eccfa2f8342fd81da5bdc157619a53f9f9 Mon Sep 17 00:00:00 2001 From: Sasa Trivic Date: Thu, 1 Feb 2024 13:56:09 +0100 Subject: [PATCH 3/6] Remove duplicate assignment --- whisper_live/client.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/whisper_live/client.py b/whisper_live/client.py index 96971c96..34fadd4b 100644 --- a/whisper_live/client.py +++ b/whisper_live/client.py @@ -78,8 +78,6 @@ def __init__( self.rate = 16000 self.record_seconds = 60000 self.recording = False - self.multilingual = False - self.language = None self.task = "transcribe" self.uid = str(uuid.uuid4()) self.waiting = False From 5b28ddefbdee16f8a5edfcccd4341e46beb0422a Mon Sep 17 00:00:00 2001 From: Sasa Trivic Date: Thu, 1 Feb 2024 14:44:07 +0100 Subject: [PATCH 4/6] Chrome extension - QOL. Remove multilingual part. --- Audio-Transcription-Chrome/options.js | 4 - Audio-Transcription-Chrome/popup.html | 185 +++++++++++++------------- Audio-Transcription-Chrome/popup.js | 23 ---- 3 files changed, 93 insertions(+), 119 deletions(-) diff --git a/Audio-Transcription-Chrome/options.js b/Audio-Transcription-Chrome/options.js index 7e8ae5b2..435d75b2 100644 --- a/Audio-Transcription-Chrome/options.js +++ b/Audio-Transcription-Chrome/options.js @@ -93,14 +93,10 @@ async function startRecord(option) { const socket = new WebSocket(`ws://${option.host}:${option.port}/`); let isServerReady = false; let language = option.language; - if (language === null && !option.multilingual) { - language = 'en'; - } socket.onopen = function(e) { socket.send( JSON.stringify({ uid: uuid, - multilingual: option.multilingual, language: option.language, task: option.task, model: option.modelSize diff --git a/Audio-Transcription-Chrome/popup.html b/Audio-Transcription-Chrome/popup.html index 3fae5484..8d45bcb2 100644 --- a/Audio-Transcription-Chrome/popup.html +++ b/Audio-Transcription-Chrome/popup.html @@ -15,112 +15,109 @@ -
- - -