mirror of
https://github.com/shirayu/whispering.git
synced 2025-01-22 06:38:13 +00:00
Add debug logs
This commit is contained in:
parent
85f9b8fc13
commit
12cd9a4f42
2 changed files with 4 additions and 1 deletions
|
@ -42,7 +42,7 @@ def transcribe_from_mic(
|
|||
):
|
||||
idx: int = 0
|
||||
while True:
|
||||
logger.debug(f"Segment: {idx}")
|
||||
logger.debug(f"Segment #: {idx}, Queue: {q.qsize()}")
|
||||
segment = q.get()
|
||||
for chunk in wsp.transcribe(segment=segment):
|
||||
print(f"{chunk.start:.2f}->{chunk.end:.2f}\t{chunk.text}")
|
||||
|
|
|
@ -90,6 +90,7 @@ class WhisperStreamingTranscriber:
|
|||
) -> List[DecodingResult]:
|
||||
assert len(self.config.temperatures) >= 1
|
||||
t = self.config.temperatures[0]
|
||||
logger.debug(f"temperature: {t}")
|
||||
|
||||
_decode_options1: DecodingOptions = self._get_decoding_options(
|
||||
t=t,
|
||||
|
@ -108,6 +109,7 @@ class WhisperStreamingTranscriber:
|
|||
and result.avg_logprob < self.config.logprob_threshold
|
||||
for result in results
|
||||
]
|
||||
logger.debug(f"Fall back with temperature: {t}, {needs_fallback}")
|
||||
if any(needs_fallback):
|
||||
_decode_options2: DecodingOptions = self._get_decoding_options(
|
||||
t=t,
|
||||
|
@ -123,6 +125,7 @@ class WhisperStreamingTranscriber:
|
|||
np.nonzero(needs_fallback)[0]
|
||||
):
|
||||
results[original_index] = retries[retry_index]
|
||||
logger.debug(f"# of results: {len(results)}")
|
||||
return results
|
||||
|
||||
def _get_chunk(
|
||||
|
|
Loading…
Reference in a new issue