Remove multilingual from client. Remove multilingual from faster whisper backend. Disable task dropdown when capturing in chrome extension.
This commit is contained in:
@@ -120,7 +120,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
stopButton.disabled = !isCapturing;
|
stopButton.disabled = !isCapturing;
|
||||||
useServerCheckbox.disabled = isCapturing;
|
useServerCheckbox.disabled = isCapturing;
|
||||||
modelSizeDropdown.disabled = isCapturing;
|
modelSizeDropdown.disabled = isCapturing;
|
||||||
|
taskDropdown.disabled = isCapturing;
|
||||||
startButton.classList.toggle("disabled", isCapturing);
|
startButton.classList.toggle("disabled", isCapturing);
|
||||||
stopButton.classList.toggle("disabled", !isCapturing);
|
stopButton.classList.toggle("disabled", !isCapturing);
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-11
@@ -76,7 +76,6 @@ class Client:
|
|||||||
self,
|
self,
|
||||||
host=None,
|
host=None,
|
||||||
port=None,
|
port=None,
|
||||||
is_multilingual=False,
|
|
||||||
lang=None,
|
lang=None,
|
||||||
translate=False,
|
translate=False,
|
||||||
model="small",
|
model="small",
|
||||||
@@ -92,8 +91,7 @@ class Client:
|
|||||||
Args:
|
Args:
|
||||||
host (str): The hostname or IP address of the server.
|
host (str): The hostname or IP address of the server.
|
||||||
port (int): The port number for the WebSocket server.
|
port (int): The port number for the WebSocket server.
|
||||||
is_multilingual (bool, optional): Specifies if multilingual transcription is enabled. Default is False.
|
lang (str, optional): The selected language for transcription. Default is None.
|
||||||
lang (str, optional): The selected language for transcription when multilingual is disabled. Default is None.
|
|
||||||
translate (bool, optional): Specifies if the task is translation. Default is False.
|
translate (bool, optional): Specifies if the task is translation. Default is False.
|
||||||
"""
|
"""
|
||||||
self.chunk = 4096
|
self.chunk = 4096
|
||||||
@@ -107,7 +105,6 @@ class Client:
|
|||||||
self.waiting = False
|
self.waiting = False
|
||||||
self.last_response_recieved = None
|
self.last_response_recieved = None
|
||||||
self.disconnect_if_no_response_for = 15
|
self.disconnect_if_no_response_for = 15
|
||||||
self.multilingual = is_multilingual
|
|
||||||
self.language = lang
|
self.language = lang
|
||||||
self.model = model
|
self.model = model
|
||||||
self.server_error = False
|
self.server_error = False
|
||||||
@@ -245,7 +242,7 @@ class Client:
|
|||||||
"""
|
"""
|
||||||
Callback function called when the WebSocket connection is successfully opened.
|
Callback function called when the WebSocket connection is successfully opened.
|
||||||
|
|
||||||
Sends an initial configuration message to the server, including client UID, multilingual mode,
|
Sends an initial configuration message to the server, including client UID,
|
||||||
language selection, and task type.
|
language selection, and task type.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -259,7 +256,6 @@ class Client:
|
|||||||
json.dumps(
|
json.dumps(
|
||||||
{
|
{
|
||||||
"uid": self.uid,
|
"uid": self.uid,
|
||||||
"multilingual": self.multilingual,
|
|
||||||
"language": self.language,
|
"language": self.language,
|
||||||
"task": self.task,
|
"task": self.task,
|
||||||
"model": self.model,
|
"model": self.model,
|
||||||
@@ -546,8 +542,7 @@ class TranscriptionClient:
|
|||||||
Args:
|
Args:
|
||||||
host (str): The hostname or IP address of the server.
|
host (str): The hostname or IP address of the server.
|
||||||
port (int): The port number to connect to on the server.
|
port (int): The port number to connect to on the server.
|
||||||
is_multilingual (bool, optional): Indicates whether the transcription should support multiple languages (default is False).
|
lang (str, optional): The primary language for transcription. Default is None, which defaults to English ('en').
|
||||||
lang (str, optional): The primary language for transcription (used if `is_multilingual` is False). Default is None, which defaults to English ('en').
|
|
||||||
translate (bool, optional): Indicates whether translation tasks are required (default is False).
|
translate (bool, optional): Indicates whether translation tasks are required (default is False).
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
@@ -556,19 +551,18 @@ class TranscriptionClient:
|
|||||||
Example:
|
Example:
|
||||||
To create a TranscriptionClient and start transcription on microphone audio:
|
To create a TranscriptionClient and start transcription on microphone audio:
|
||||||
```python
|
```python
|
||||||
transcription_client = TranscriptionClient(host="localhost", port=9090, is_multilingual=True)
|
transcription_client = TranscriptionClient(host="localhost", port=9090)
|
||||||
transcription_client()
|
transcription_client()
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
host,
|
host,
|
||||||
port,
|
port,
|
||||||
is_multilingual=False,
|
|
||||||
lang=None,
|
lang=None,
|
||||||
translate=False,
|
translate=False,
|
||||||
model="small",
|
model="small",
|
||||||
):
|
):
|
||||||
self.client = Client(host, port, is_multilingual, lang, translate, model)
|
self.client = Client(host, port, lang, translate, model)
|
||||||
|
|
||||||
def __call__(self, audio=None, hls_url=None):
|
def __call__(self, audio=None, hls_url=None):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -155,7 +155,6 @@ class TranscriptionServer:
|
|||||||
options["model"] = faster_whisper_custom_model_path
|
options["model"] = faster_whisper_custom_model_path
|
||||||
client = ServeClientFasterWhisper(
|
client = ServeClientFasterWhisper(
|
||||||
websocket,
|
websocket,
|
||||||
multilingual=False,
|
|
||||||
language=options["language"],
|
language=options["language"],
|
||||||
task=options["task"],
|
task=options["task"],
|
||||||
client_uid=options["uid"],
|
client_uid=options["uid"],
|
||||||
@@ -559,7 +558,6 @@ class ServeClientFasterWhisper(ServeClientBase):
|
|||||||
websocket,
|
websocket,
|
||||||
task="transcribe",
|
task="transcribe",
|
||||||
device=None,
|
device=None,
|
||||||
multilingual=False,
|
|
||||||
language=None,
|
language=None,
|
||||||
client_uid=None,
|
client_uid=None,
|
||||||
model="small.en",
|
model="small.en",
|
||||||
@@ -576,7 +574,6 @@ class ServeClientFasterWhisper(ServeClientBase):
|
|||||||
websocket (WebSocket): The WebSocket connection for the client.
|
websocket (WebSocket): The WebSocket connection for the client.
|
||||||
task (str, optional): The task type, e.g., "transcribe." Defaults to "transcribe".
|
task (str, optional): The task type, e.g., "transcribe." Defaults to "transcribe".
|
||||||
device (str, optional): The device type for Whisper, "cuda" or "cpu". Defaults to None.
|
device (str, optional): The device type for Whisper, "cuda" or "cpu". Defaults to None.
|
||||||
multilingual (bool, optional): Whether the client supports multilingual transcription. Defaults to False.
|
|
||||||
language (str, optional): The language for transcription. Defaults to None.
|
language (str, optional): The language for transcription. Defaults to None.
|
||||||
client_uid (str, optional): A unique identifier for the client. Defaults to None.
|
client_uid (str, optional): A unique identifier for the client. Defaults to None.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user