Compare commits
6 Commits
master
...
4b64ef1f70
| Author | SHA1 | Date | |
|---|---|---|---|
|
4b64ef1f70
|
|||
|
d04e685ca2
|
|||
|
b835bdaaf1
|
|||
|
9f24e2c735
|
|||
|
9a646b69e6
|
|||
|
49af9564ab
|
@@ -454,6 +454,7 @@ class WhisperModel:
|
|||||||
clip_idx = 0
|
clip_idx = 0
|
||||||
seek = seek_clips[clip_idx][0]
|
seek = seek_clips[clip_idx][0]
|
||||||
all_tokens = []
|
all_tokens = []
|
||||||
|
all_prompt_text = []
|
||||||
prompt_reset_since = 0
|
prompt_reset_since = 0
|
||||||
|
|
||||||
if options.initial_prompt is not None:
|
if options.initial_prompt is not None:
|
||||||
@@ -724,7 +725,15 @@ class WhisperModel:
|
|||||||
if segment["start"] == segment["end"] or not text.strip():
|
if segment["start"] == segment["end"] or not text.strip():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
check_prompt_num = 1
|
||||||
|
if all(
|
||||||
|
[
|
||||||
|
text.strip() != i.strip()
|
||||||
|
for i in all_prompt_text[-check_prompt_num:]
|
||||||
|
]
|
||||||
|
):
|
||||||
all_tokens.extend(tokens)
|
all_tokens.extend(tokens)
|
||||||
|
all_prompt_text.append(text)
|
||||||
idx += 1
|
idx += 1
|
||||||
|
|
||||||
yield Segment(
|
yield Segment(
|
||||||
|
|||||||
Reference in New Issue
Block a user