mirror of
https://github.com/patw/AudioSumma.git
synced 2025-09-01 10:09:56 +00:00
Skip transcribe step if it's already done. Show each part being summarized.
This commit is contained in:
parent
2d329d4806
commit
933b9e24d4
1 changed files with 9 additions and 0 deletions
|
@ -57,6 +57,14 @@ def process_wav_files():
|
||||||
"""Process WAV files: trim silence and transcribe."""
|
"""Process WAV files: trim silence and transcribe."""
|
||||||
wav_files = [f for f in os.listdir(".") if f.endswith(".wav")]
|
wav_files = [f for f in os.listdir(".") if f.endswith(".wav")]
|
||||||
for wav_file in wav_files:
|
for wav_file in wav_files:
|
||||||
|
# Generate the expected transcript filename
|
||||||
|
transcript_file = os.path.splitext(wav_file)[0] + ".tns"
|
||||||
|
|
||||||
|
# Check if transcript already exists
|
||||||
|
if os.path.exists(transcript_file):
|
||||||
|
print(f"Transcript already exists for {wav_file}, skipping transcription")
|
||||||
|
continue
|
||||||
|
|
||||||
print("Trimming silence: " + wav_file)
|
print("Trimming silence: " + wav_file)
|
||||||
trim_silence(wav_file)
|
trim_silence(wav_file)
|
||||||
|
|
||||||
|
@ -95,6 +103,7 @@ def summarize_transcripts():
|
||||||
|
|
||||||
with open(summary_filename, "a") as md_file:
|
with open(summary_filename, "a") as md_file:
|
||||||
for i, chunk in enumerate(chunked_data):
|
for i, chunk in enumerate(chunked_data):
|
||||||
|
print("Processing part " + str(i))
|
||||||
summary = llm_local(SUMMARY_PROMPT.format(chunk=chunk))
|
summary = llm_local(SUMMARY_PROMPT.format(chunk=chunk))
|
||||||
facts = llm_local(FACT_PROMPT.format(chunk=chunk))
|
facts = llm_local(FACT_PROMPT.format(chunk=chunk))
|
||||||
sentiment = llm_local(SENTIMENT_PROMPT.format(chunk=chunk))
|
sentiment = llm_local(SENTIMENT_PROMPT.format(chunk=chunk))
|
||||||
|
|
Loading…
Add table
Reference in a new issue