Fix chmod argument order, use whisper-cli, relocate constants
Assisted-by: Claude Opus 4.6 via pi
diff --git a/Rakefile b/Rakefile
index ec25231..ae39c76 100644
--- a/Rakefile
+++ b/Rakefile
@@ -13,8 +13,6 @@ HRN_FEED_URL = "https://rss.art19.com/cooking-issues"
TRANSCRIBER = ENV.fetch("TRANSCRIBER", "whisperx")
WHISPER_MODEL = ENV.fetch("WHISPER_MODEL", "large-v3-turbo")
MODELS_DIR = CACHE_DIR / "models"
-DOWNLOAD_SCRIPT = CACHE_DIR / "download-ggml-model.sh"
-DOWNLOAD_SCRIPT_URL = "https://raw.githubusercontent.com/ggml-org/whisper.cpp/master/models/download-ggml-model.sh"
directory CACHE_DIR.to_s
directory AUDIO_DIR.to_s
@@ -33,10 +31,13 @@ file SOUS_CHEF.to_s do
sh "cd sous_chef && swift build -c release"
end
+DOWNLOAD_SCRIPT = CACHE_DIR / "download-ggml-model.sh"
+DOWNLOAD_SCRIPT_URL = "https://raw.githubusercontent.com/ggml-org/whisper.cpp/master/models/download-ggml-model.sh"
+
file DOWNLOAD_SCRIPT.to_s => CACHE_DIR.to_s do
puts "Downloading whisper model script..."
CookingIssues::Download.fetch(DOWNLOAD_SCRIPT_URL, DOWNLOAD_SCRIPT.to_s)
- chmod DOWNLOAD_SCRIPT.to_s, 0o755
+ chmod 0o755, DOWNLOAD_SCRIPT.to_s
end
desc "Download a whisper.cpp GGML model (default: large-v3-turbo, override with WHISPER_MODEL)"
@@ -63,11 +64,11 @@ def transcribe(ep, audio_path, transcript_path)
when "whisper-cpp-large"
model_path = MODELS_DIR / "ggml-large-v3-turbo.bin"
Rake::Task[:model].invoke("large-v3-turbo") unless model_path.exist?
- sh "whisper-cpp", "--model", model_path.to_s, "--tdrz", "--output-txt", "--output-file", transcript_path.delete_suffix(".txt"), audio_path
+ sh "whisper-cli", "--model", model_path.to_s, "--output-txt", "--output-file", transcript_path.delete_suffix(".txt"), audio_path
when "whisper-cpp-tdrz"
model_path = MODELS_DIR / "ggml-small.en-tdrz.bin"
Rake::Task[:model].invoke("small.en-tdrz") unless model_path.exist?
- sh "whisper-cpp", "--model", model_path.to_s, "--tdrz", "--output-txt", "--output-file", transcript_path.delete_suffix(".txt"), audio_path
+ sh "whisper-cli", "--model", model_path.to_s, "-tdrz", "--output-txt", "--output-file", transcript_path.delete_suffix(".txt"), audio_path
when "sous_chef"
Rake::Task[SOUS_CHEF.to_s].invoke
sh SOUS_CHEF.to_s, audio_path, transcript_path