From 6b0a5f35604848ca84c9064496a16497aed98f52 Mon Sep 17 00:00:00 2001 From: nick huang Date: Tue, 17 Mar 2026 20:49:14 +0800 Subject: [PATCH] now gpu fixed. gemini has a timeout ends earlier explanantion with a simple accurate time start --- doubao_mic.cpp | 4 ++-- run.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doubao_mic.cpp b/doubao_mic.cpp index b1f0f7c7f..7e8f3f1cf 100644 --- a/doubao_mic.cpp +++ b/doubao_mic.cpp @@ -177,7 +177,7 @@ void recognize_audio(struct whisper_context* ctx, const std::vector& audi wparams.max_len = 0; wparams.translate = false; wparams.no_context = true; - wparams.single_segment = true; + wparams.single_segment = false; wparams.print_special = false; wparams.token_timestamps = false; @@ -251,7 +251,7 @@ int main(int argc, char** argv) { // 4. 初始化 Whisper 模型 struct whisper_context_params cparams = whisper_context_default_params(); - cparams.use_gpu = false; + cparams.use_gpu = true; printf("\n🚀 正在加载模型:%s\n", model_path); struct whisper_context* ctx = whisper_init_from_file_with_params(model_path, cparams); diff --git a/run.txt b/run.txt index 64082a140..1dbc2c480 100644 --- a/run.txt +++ b/run.txt @@ -13,3 +13,4 @@ export CUDA_HOME=/usr/local/cuda-13.1 export PATH=$CUDA_HOME/bin:$PATH export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$CUDA_HOME/targets/x86_64-linux/lib:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$(pwd)/build_gpu/src:$(pwd)/build_gpu/ggml/src:/usr/local/cuda-13.1/lib64:/usr/local/cuda-13.1/targets/x86_64-linux/lib:$LD_LIBRARY_PATH