Fix: Omitting the last chunk problem in comp_unaware mode
Browse files- whisper_online.py +7 -2
whisper_online.py
CHANGED
@@ -573,10 +573,15 @@ if __name__ == "__main__":
|
|
573 |
|
574 |
print(f"## last processed {end:.2f}s",file=logfile,flush=True)
|
575 |
|
576 |
-
beg = end
|
577 |
-
end += min_chunk
|
578 |
if end >= duration:
|
579 |
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
580 |
now = duration
|
581 |
|
582 |
else: # online = simultaneous mode
|
|
|
573 |
|
574 |
print(f"## last processed {end:.2f}s",file=logfile,flush=True)
|
575 |
|
|
|
|
|
576 |
if end >= duration:
|
577 |
break
|
578 |
+
|
579 |
+
beg = end
|
580 |
+
|
581 |
+
if end + min_chunk > duration:
|
582 |
+
end = duration
|
583 |
+
else:
|
584 |
+
end += min_chunk
|
585 |
now = duration
|
586 |
|
587 |
else: # online = simultaneous mode
|