Spaces:
Runtime error
Runtime error
liuyang
commited on
Commit
·
aa984fe
1
Parent(s):
caef0e2
enable result printing and comment out text cleanup regex
Browse files
app.py
CHANGED
|
@@ -432,7 +432,7 @@ class WhisperTranscriber:
|
|
| 432 |
|
| 433 |
transcription_time = time.time() - start_time
|
| 434 |
print(f"Full audio transcribed in {transcription_time:.2f} seconds using batch size {batch_size}")
|
| 435 |
-
|
| 436 |
return results, detected_language
|
| 437 |
|
| 438 |
# Removed audio cutting; transcription is done once on the full (preprocessed) audio
|
|
@@ -642,7 +642,7 @@ class WhisperTranscriber:
|
|
| 642 |
# Clean up text
|
| 643 |
for segment in grouped_segments:
|
| 644 |
segment["text"] = re.sub(r"\s+", " ", segment["text"]).strip()
|
| 645 |
-
segment["text"] = re.sub(r"\s+([.,!?])", r"\1", segment["text"])
|
| 646 |
|
| 647 |
return grouped_segments
|
| 648 |
|
|
|
|
| 432 |
|
| 433 |
transcription_time = time.time() - start_time
|
| 434 |
print(f"Full audio transcribed in {transcription_time:.2f} seconds using batch size {batch_size}")
|
| 435 |
+
print(results)
|
| 436 |
return results, detected_language
|
| 437 |
|
| 438 |
# Removed audio cutting; transcription is done once on the full (preprocessed) audio
|
|
|
|
| 642 |
# Clean up text
|
| 643 |
for segment in grouped_segments:
|
| 644 |
segment["text"] = re.sub(r"\s+", " ", segment["text"]).strip()
|
| 645 |
+
#segment["text"] = re.sub(r"\s+([.,!?])", r"\1", segment["text"])
|
| 646 |
|
| 647 |
return grouped_segments
|
| 648 |
|