Commit
·
b18d80f
1
Parent(s):
937fc50
sep for mlx is also ""
Browse files
src/whisper_streaming/backends.py
CHANGED
|
@@ -164,7 +164,7 @@ class MLXWhisper(ASRBase):
|
|
| 164 |
Significantly faster than faster-whisper (without CUDA) on Apple M1.
|
| 165 |
"""
|
| 166 |
|
| 167 |
-
sep = "
|
| 168 |
|
| 169 |
def load_model(self, modelsize=None, cache_dir=None, model_dir=None):
|
| 170 |
"""
|
|
|
|
| 164 |
Significantly faster than faster-whisper (without CUDA) on Apple M1.
|
| 165 |
"""
|
| 166 |
|
| 167 |
+
sep = "" # In my experience in french it should also be no space.
|
| 168 |
|
| 169 |
def load_model(self, modelsize=None, cache_dir=None, model_dir=None):
|
| 170 |
"""
|
src/whisper_streaming/online_asr.py
CHANGED
|
@@ -175,7 +175,13 @@ class OnlineASRProcessor:
|
|
| 175 |
if (
|
| 176 |
len(self.audio_buffer) / self.SAMPLING_RATE > self.buffer_trimming_sec
|
| 177 |
): # longer than this
|
|
|
|
|
|
|
| 178 |
self.chunk_completed_sentence()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
|
| 180 |
if self.buffer_trimming_way == "segment":
|
| 181 |
s = self.buffer_trimming_sec # trim the completed segments longer than s,
|
|
@@ -286,7 +292,7 @@ class OnlineASRProcessor:
|
|
| 286 |
"""
|
| 287 |
o = self.transcript_buffer.complete()
|
| 288 |
f = self.to_flush(o)
|
| 289 |
-
logger.debug(f"last, noncommited: {f}")
|
| 290 |
self.buffer_time_offset += len(self.audio_buffer) / 16000
|
| 291 |
return f
|
| 292 |
|
|
|
|
| 175 |
if (
|
| 176 |
len(self.audio_buffer) / self.SAMPLING_RATE > self.buffer_trimming_sec
|
| 177 |
): # longer than this
|
| 178 |
+
|
| 179 |
+
logger.debug("chunking sentence")
|
| 180 |
self.chunk_completed_sentence()
|
| 181 |
+
|
| 182 |
+
|
| 183 |
+
else:
|
| 184 |
+
logger.debug("not enough audio to trim as a sentence")
|
| 185 |
|
| 186 |
if self.buffer_trimming_way == "segment":
|
| 187 |
s = self.buffer_trimming_sec # trim the completed segments longer than s,
|
|
|
|
| 292 |
"""
|
| 293 |
o = self.transcript_buffer.complete()
|
| 294 |
f = self.to_flush(o)
|
| 295 |
+
logger.debug(f"last, noncommited: {f[0]*1000:.0f}-{f[1]*1000:.0f}: {f[2]}")
|
| 296 |
self.buffer_time_offset += len(self.audio_buffer) / 16000
|
| 297 |
return f
|
| 298 |
|