podcast-sponsor-remove

Attempt at identify sponsored segments in audio transcripts and removing them.
Log | Files | Refs

commit 3b4865a270888643446d9092ba55d69b79117e5e
parent a08bed429831b989b57b732ce04bf7158abc2cc1
Author: vin <git@vineetk.net>
Date:   Fri, 22 Aug 2025 23:28:51 -0400

whisper.cpp replaced by onnx-asr

Diffstat:
Dtranscript.py | 42------------------------------------------
1 file changed, 0 insertions(+), 42 deletions(-)

diff --git a/transcript.py b/transcript.py @@ -1,42 +0,0 @@ -import os -import subprocess -import sys -from tqdm import tqdm - -# hardcoded because lazy -WHISPER_DIR = "/data/src/clones/llm/whisper.cpp" -WHISPER_MODEL = "ggml-large-v3-turbo-q5_0" -#WHISPER_MODEL = "ggml-distil-large-v3.5" - -def transcribe_file(input_file): - base, _ = os.path.splitext(input_file) - output_file = base + '.txt' - - if os.path.exists(output_file): - return - - whisper_cli = f"{WHISPER_DIR}/build/bin/whisper-cli" - model_path = f"{WHISPER_DIR}/models/{WHISPER_MODEL}.bin" - - cmd = [whisper_cli, '-m', model_path, input_file] - - result = subprocess.run(cmd, capture_output=True, text=True) - if result.returncode != 0: - print(f"Error transcribing {input_file}: {result.stderr}") - return - with open(output_file, 'w', encoding='utf-8') as f: - f.write(result.stdout) - -def main(): - inputs = sys.argv[1:] - if not inputs: - print("No input files given") - return - - with tqdm(inputs) as pbar: - for file in pbar: - pbar.set_description(f"Transcribing {os.path.basename(file)}") - transcribe_file(file) - -if __name__ == '__main__': - main()