Skip to content

Commit c9bff0f

Browse files
committed
fix(stt): fail configure if the patched whisper.cpp is not compiled; read the harness port from the helper env
1 parent 4ed6a9c commit c9bff0f

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎electron/native/whisper-stt/CMakeLists.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ configure_file("${CMAKE_CURRENT_BINARY_DIR}/whisper-patched/whisper.cpp.tmp"
174174
"${CMAKE_CURRENT_BINARY_DIR}/whisper-patched/whisper.cpp" COPYONLY)
175175
get_target_property(osc_whisper_srcs whisper SOURCES)
176176
list(TRANSFORM osc_whisper_srcs REPLACE "^whisper\\.cpp$" "${CMAKE_CURRENT_BINARY_DIR}/whisper-patched/whisper.cpp")
177+
if(NOT "${CMAKE_CURRENT_BINARY_DIR}/whisper-patched/whisper.cpp" IN_LIST osc_whisper_srcs)
178+
message(FATAL_ERROR "char-dtw: the whisper target does not list whisper.cpp as expected (${osc_whisper_srcs})")
179+
endif()
177180
set_property(TARGET whisper PROPERTY SOURCES ${osc_whisper_srcs})
178181

179182
add_executable(whisper-stt-server src/main.cpp)

‎tools/stt-eval/word-timing/lib.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const SR = 16000;
2727
* 20500-20599 (OSC_WORD_TIMING_PORT moves the range) and waits until it answers. The process is killed on exit.
2828
*/
2929
export async function startHelper(exe, { cpu = false, env = process.env } = {}) {
30-
const port = Number(process.env.OSC_WORD_TIMING_PORT ?? 20500) + Math.floor(Math.random() * 100);
30+
const port = Number(env.OSC_WORD_TIMING_PORT ?? 20500) + Math.floor(Math.random() * 100);
3131
const args = [
3232
"--model",
3333
path.join(MODELS, "ggml-small-q8_0.bin"),

0 commit comments

Comments
 (0)