Update app.py
Browse files
app.py
CHANGED
@@ -573,14 +573,13 @@ def calibrated_speed(text, desired_duration):
|
|
573 |
cps = char_count / desired_duration # characters per second
|
574 |
|
575 |
# Truncated linear mapping
|
576 |
-
if cps <
|
577 |
return 1.0
|
578 |
-
elif cps >
|
579 |
-
return
|
580 |
else:
|
581 |
-
|
582 |
-
|
583 |
-
return 1.0 + slope * (cps - 10)
|
584 |
|
585 |
|
586 |
def upload_and_manage(file, target_language, mode="transcription"):
|
|
|
573 |
cps = char_count / desired_duration # characters per second
|
574 |
|
575 |
# Truncated linear mapping
|
576 |
+
if cps < 14:
|
577 |
return 1.0
|
578 |
+
elif cps > 30:
|
579 |
+
return 2
|
580 |
else:
|
581 |
+
slope = (2 - 1.0) / (30 - 14)
|
582 |
+
return 1.0 + slope * (cps - 14)
|
|
|
583 |
|
584 |
|
585 |
def upload_and_manage(file, target_language, mode="transcription"):
|