Преглед на файлове

Update decoding.py (#1219)

Jong Wook Kim преди 2 години
родител
ревизия
c09a7ae299
променени са 1 файла, в които са добавени 1 реда и са изтрити 3 реда
  1. 1 3
      whisper/decoding.py

+ 1 - 3
whisper/decoding.py

@@ -469,9 +469,7 @@ class ApplyTimestampRules(LogitFilter):
             ]
             if timestamps.numel() > 0:
                 # timestamps shouldn't decrease; forbid timestamp tokens smaller than the last
-                logits[k, self.tokenizer.timestamp_begin : timestamps[-1]] = -np.inf
-
-                # to force that timestamps are strictly increasing
+                # also force each segment to have a nonzero length, to prevent infinite looping
                 if last_was_timestamp and not penultimate_was_timestamp:
                     timestamp_last = timestamps[-1]
                 else: