diff options
| author | yum <yum.food.vr@gmail.com> | 2023-02-19 11:46:43 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2023-02-19 12:10:13 -0800 |
| commit | 52f743e43a9ef582e04d7a363fbda19824db6cc7 (patch) | |
| tree | c3493a0feb31f4d0bcf07b31a8f1c6bdf1dfd38b /Scripts | |
| parent | bd72a8e97e120604405f2330664e9658e44e3de1 (diff) | |
Remove exponential backoff capv0.7.0
Allows sustained exponential backoff when not transcribing. Used to cap
out at 1s.
* Add more items to README TODO list
* Adjust emote metadata
* Emotes bugfix: Non-existent emote map doesn't cause transcription
engine to bail out.
Diffstat (limited to 'Scripts')
| -rw-r--r-- | Scripts/emotes_v2.py | 8 | ||||
| -rw-r--r-- | Scripts/transcribe.py | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/Scripts/emotes_v2.py b/Scripts/emotes_v2.py index 165db7c..aaf8d18 100644 --- a/Scripts/emotes_v2.py +++ b/Scripts/emotes_v2.py @@ -68,8 +68,12 @@ class EmotesState: self.bits = {} def load(self, pickle_path): - with open(pickle_path, 'rb') as f: - self.bits = pickle.load(f) + try: + with open(pickle_path, 'rb') as f: + self.bits = pickle.load(f) + except FileNotFoundError: + print(f"Emotes map does not exist at {pickle_path}", + file=sys.stderr) # This is quite slow since we do a search and replace (O(n)) # for each keyword O(m) times each variant of said keyword (O(k)). diff --git a/Scripts/transcribe.py b/Scripts/transcribe.py index d67edb6..c4d7682 100644 --- a/Scripts/transcribe.py +++ b/Scripts/transcribe.py @@ -252,10 +252,9 @@ def transcribeAudio(audio_state, model, use_cpu: bool): else: time.sleep(0.05) + audio_state.transcribe_no_change_count += 1 # Increase sleep time. Code below will set sleep time back to minimum # if a change is detected. - if audio_state.transcribe_no_change_count < 10: - audio_state.transcribe_no_change_count += 1 longer_sleep_dur = audio_state.transcribe_sleep_duration longer_sleep_dur += audio_state.transcribe_sleep_duration_min_s * (1.3**audio_state.transcribe_no_change_count) if audio_state.audio_paused: |
