diff options
| author | yum <yum.food.vr@gmail.com> | 2023-12-26 20:08:17 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2023-12-26 20:08:17 -0800 |
| commit | 89e9376820e7e817b7d0052e28e973d423715811 (patch) | |
| tree | 5ac72b4f580e1ea2c604805ca0a4fa7f148a87d2 | |
| parent | 46e07cd1f0a5e0d5d9d4f48a62fcb01cec9eacd5 (diff) | |
Also include it in the package.
| -rw-r--r-- | app.py | 9 | ||||
| -rw-r--r-- | curate/Makefile | 2 | ||||
| -rw-r--r-- | pkg/package.ps1 | 7 |
3 files changed, 16 insertions, 2 deletions
@@ -578,18 +578,21 @@ def stopApp(): def transcribeAudio(concatenated_path: str): # Step 1: Install Whisper requirements + print("Installing Whisper dependencies, this will take several minutes") with open("whisper_requirements.txt", "r") as file: requirements = file.read().splitlines() if not pipInstall(requirements): return # Step 2: Iterate over .wav files in the current working directory + print("Loading Whisper model, this will take several minutes") whisper = Whisper(None) for wav_file in os.listdir('.'): if wav_file.endswith('.wav'): if wav_file.endswith(os.path.basename(concatenated_path)): print("Skipping concatenated file") continue + # Step 3: Transcription pipeline # TODO parameterize high fidelity framerate print(f"Transcribing {wav_file}") @@ -597,11 +600,15 @@ def transcribeAudio(concatenated_path: str): collector = CompressingAudioCollector(AudioCollector(disk_stream)) whisper.collector = collector + transcript_filename = wav_file.replace('.wav', '.txt') + if os.path.exists(transcript_filename): + print(f"Transcript already exists - skipping") + continue + # Transcribe the audio segments = whisper.transcribe() # Step 4: Save transcriptions - transcript_filename = wav_file.replace('.wav', '.txt') with open(transcript_filename, 'w') as txt_file: for segment in segments: txt_file.write(segment.transcript + '\n') diff --git a/curate/Makefile b/curate/Makefile index d4e63dc..d8e32f8 100644 --- a/curate/Makefile +++ b/curate/Makefile @@ -1,6 +1,6 @@ CC=g++ CFLAGS=-c -O2 -std=c++20 -LDFLAGS=-lcurses +LDFLAGS=-lcurses -ltinfo -static EXE=ui SRCS=ui.cc diff --git a/pkg/package.ps1 b/pkg/package.ps1 index 694cdea..3ba0568 100644 --- a/pkg/package.ps1 +++ b/pkg/package.ps1 @@ -70,11 +70,18 @@ if (-Not (Test-Path "silero-vad")) { git clone "https://github.com/snakers4/silero-vad" } +if (-Not (Test-Path "../curate/ui")) { + pushd ../curate/ui >$null + make + popd >$null +} + mkdir $install_dir > $null mkdir $install_dir/Models cp ../*.py $install_dir/ cp ../*.bat $install_dir/ cp ../*.txt $install_dir/ +cp ../curate/ui $install_dir/curation_tui_wsl cp -Recurse Python $install_dir/Python cp "silero-vad/files/silero_vad.onnx" $install_dir/Models/ cp "silero-vad/LICENSE" $install_dir/Models/silero_vad.onnx.LICENSE |
