qqwjq1981 commited on
Commit
35650ec
·
verified ·
1 Parent(s): 871bb78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
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 < 10:
577
  return 1.0
578
- elif cps > 25:
579
- return 1.6
580
  else:
581
- # Linearly scale between cps 10 -> 25 and speed 1.0 -> 1.3
582
- slope = (1.6 - 1.0) / (25 - 10)
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"):