Bound transcript memory and translation queue size
- 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()
This commit is contained in:
@@ -191,7 +191,7 @@ class TranscriptionServer:
|
||||
|
||||
if enable_translation:
|
||||
target_language = options.get("target_language", "fr")
|
||||
translation_queue = queue.Queue()
|
||||
translation_queue = queue.Queue(maxsize=ServeClientBase.MAX_TRANSLATION_QUEUE_SIZE)
|
||||
from whisper_live.backend.translation_backend import ServeClientTranslation
|
||||
translation_client = ServeClientTranslation(
|
||||
client_uid=options["uid"],
|
||||
|
||||
Reference in New Issue
Block a user