daihui.zhang
commited on
Commit
·
9df3704
1
Parent(s):
65a4e8d
fix error of merge chunks
Browse files- transcribe/strategy.py +2 -1
transcribe/strategy.py
CHANGED
|
@@ -309,11 +309,12 @@ class TranscriptStabilityAnalyzer:
|
|
| 309 |
logger.debug(f"Current separator: {self._separator}")
|
| 310 |
|
| 311 |
def merge_chunks(self, chunks: List[TranscriptChunk])->str:
|
|
|
|
|
|
|
| 312 |
output = list(r.join() for r in chunks if r)
|
| 313 |
return output
|
| 314 |
|
| 315 |
|
| 316 |
-
|
| 317 |
def analysis(self, current: TranscriptChunk, buffer_duration: float) -> Iterator[TranscriptResult]:
|
| 318 |
current = TranscriptChunk(items=current, separator=self._separator)
|
| 319 |
self._transcript_history.add(current)
|
|
|
|
| 309 |
logger.debug(f"Current separator: {self._separator}")
|
| 310 |
|
| 311 |
def merge_chunks(self, chunks: List[TranscriptChunk])->str:
|
| 312 |
+
if not chunks:
|
| 313 |
+
return [""]
|
| 314 |
output = list(r.join() for r in chunks if r)
|
| 315 |
return output
|
| 316 |
|
| 317 |
|
|
|
|
| 318 |
def analysis(self, current: TranscriptChunk, buffer_duration: float) -> Iterator[TranscriptResult]:
|
| 319 |
current = TranscriptChunk(items=current, separator=self._separator)
|
| 320 |
self._transcript_history.add(current)
|