From f28d37e33e3662072eac44e3dcb09750bad87968 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 25 Jan 2025 11:43:27 +0530 Subject: [PATCH] add TRANSCRIBE_TARGET_LENGTH setting --- transcribe.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transcribe.py b/transcribe.py index 748a80c..622feb3 100644 --- a/transcribe.py +++ b/transcribe.py @@ -21,6 +21,7 @@ from user.models import User logger = logging.getLogger(__name__) +TARGET_LENGTH = getattr(settings, 'TRANSCRIBE_TARGET_LENGTH', 200) def prepare_annotations(result, join_sentences=False): if join_sentences: @@ -37,7 +38,7 @@ def prepare_annotations(result, join_sentences=False): return annotations -def prepare_joint_annotations(result, target_length=200): +def prepare_joint_annotations(result, target_length=TARGET_LENGTH): abbrevs = ["Mr.", "Mrs.", "Dr."] ignore = [] phrase_sounds = []