- max_clients must be >= 1
- max_connection_time must be > 0
- batch_max_size must be >= 1 (when batch enabled)
- batch_window_ms must be >= 0 (when batch enabled)
- Added 5 new tests for parameter validation
- Add MAX_TRANSCRIPT_LENGTH (500) and MAX_TRANSLATION_QUEUE_SIZE (100)
class constants to ServeClientBase
- Trim transcript and text lists after each update_segments() call
- Create translation queue with maxsize to prevent unbounded growth
- Added tests for _trim_transcript()
- All ClientManager methods (add_client, get_client, remove_client,
get_wait_time, is_server_full, is_client_timeout) now protected by
a threading.Lock
- cleanup() called outside the lock to avoid holding it during I/O
- is_server_full() computes wait time inline under lock instead of
calling get_wait_time() to avoid nested lock acquisition
- Added concurrent thread safety tests for add/remove and get operations
When VAD removes all speech from an audio chunk, transcriber.transcribe() returns (None, info). Calling list(None) raises TypeError. The _process_multi path already handles this case; this aligns _process_single to match.
Replace hardcoded [-4:] truncation with a configurable display_segments
parameter (default: 4) in both Client and TranscriptionClient classes.
Fixes#377
Add `--enable-timestamps` option to `run_client.py`
script to print out transcripted text with timestamps.
Sample output with translation enabled:
```
[0.000 -> 7.440] And so, my fellow Americans, ask not what your country can do for you.
[7.440 -> 10.300] Ask what you can do for your country.
TRANSLATION to fr:
[0.000 -> 7.440] Et donc, mes camarades américains, ne demandez pas ce que votre pays peut faire pour vous.
[7.440 -> 10.300] Demandez ce que vous pouvez faire pour votre pays.
```
Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
Previously, the server only accepted local file paths for custom Faster Whisper
models. This change allows passing HuggingFace repo IDs which are automatically
downloaded and converted to CTranslate2 format by the backend if not already in
CTranslate2 format.
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
Translate from any language to any language with alirezamsh/small100
running in a thread and reading from a queue shared with transcription thread.
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
Added the `use_wss` parameter to allow the client to handle WebSocket-based streaming. This enhances flexibility for real-time transcription scenarios.
Introduce an optional `use_wss` flag to enable secure WebSocket protocol. Updated socket URL generation to dynamically select between `ws` or `wss` based on the flag value. Ensures greater flexibility when connecting to secure servers.