LAP-DEV commited on
Commit
e3c663b
·
verified ·
1 Parent(s): 250eec1

Update modules/whisper/whisper_base.py

Browse files
Files changed (1) hide show
  1. modules/whisper/whisper_base.py +16 -4
modules/whisper/whisper_base.py CHANGED
@@ -553,13 +553,25 @@ class WhisperBase(ABC):
553
  minutes, seconds = divmod(rem, 60)
554
 
555
  time_str = ""
 
556
  if hours:
557
- time_str += f"{hours} hours "
 
 
 
 
558
  if minutes:
559
- time_str += f"{minutes} minutes "
 
 
 
 
560
  seconds = round(seconds)
561
- time_str += f"{seconds} seconds"
562
-
 
 
 
563
  return time_str.strip()
564
 
565
  @staticmethod
 
553
  minutes, seconds = divmod(rem, 60)
554
 
555
  time_str = ""
556
+
557
  if hours:
558
+ if hours == 1:
559
+ time_str += f"{hours} hour "
560
+ else:
561
+ time_str += f"{hours} hours "
562
+
563
  if minutes:
564
+ if minutes == 1:
565
+ time_str += f"{minutes} minute "
566
+ else:
567
+ time_str += f"{minutes} minutes "
568
+
569
  seconds = round(seconds)
570
+ if seconds == 1:
571
+ time_str += f"{seconds} second"
572
+ else:
573
+ time_str += f"{seconds} seconds"
574
+
575
  return time_str.strip()
576
 
577
  @staticmethod