]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
examples : initialize context params properly (#1852)
authorGeorgi Gerganov <redacted>
Sun, 11 Feb 2024 14:39:12 +0000 (16:39 +0200)
committerGeorgi Gerganov <redacted>
Sun, 11 Feb 2024 14:39:12 +0000 (16:39 +0200)
examples/addon.node/addon.cpp
examples/bench/bench.cpp
examples/command/command.cpp
examples/lsp/lsp.cpp
examples/main/main.cpp
examples/server/server.cpp
examples/stream/stream.cpp
examples/talk-llama/talk-llama.cpp
examples/talk/talk.cpp
examples/wchess/wchess.cmd/wchess.cmd.cpp

index 30acbc6afd8da8452a057e85cc30f8e85bee8ea3..ba3c3edab0f93623f532638900efd4281ff5aef6 100644 (file)
@@ -154,7 +154,7 @@ int run(whisper_params &params, std::vector<std::vector<std::string>> &result) {
 
     // whisper init
 
-    struct whisper_context_params cparams;
+    struct whisper_context_params cparams = whisper_context_default_params();
     cparams.use_gpu = params.use_gpu;
     struct whisper_context * ctx = whisper_init_from_file_with_params(params.model.c_str(), cparams);
 
index 949e5737167ef662dac68c5868a4cbb3d7b7028e..60d10a2cb565ef6612df688bbe35de6b882beedb 100644 (file)
@@ -58,7 +58,7 @@ void whisper_print_usage(int /*argc*/, char ** argv, const whisper_params & para
 int whisper_bench_full(const whisper_params & params) {
     // whisper init
 
-    struct whisper_context_params cparams;
+    struct whisper_context_params cparams = whisper_context_default_params();
     cparams.use_gpu = params.use_gpu;
 
     struct whisper_context * ctx = whisper_init_from_file_with_params(params.model.c_str(), cparams);
index 51d800a2f2ef1c51f56b247129f7b788bbbb2093..0ab7b67bd1d56440ab2340ee278d1b93633d7cf4 100644 (file)
@@ -693,7 +693,7 @@ int main(int argc, char ** argv) {
 
     // whisper init
 
-    struct whisper_context_params cparams;
+    struct whisper_context_params cparams = whisper_context_default_params();
     cparams.use_gpu = params.use_gpu;
 
     struct whisper_context * ctx = whisper_init_from_file_with_params(params.model.c_str(), cparams);
index 8d8b6ffa238892cdadcddadc1b6af7cd9311ed31..e5f8360f83dae26baf16478d196392232b07bb63 100644 (file)
@@ -435,7 +435,7 @@ int main(int argc, char ** argv) {
     }
 
     // whisper init
-    struct whisper_context_params cparams;
+    struct whisper_context_params cparams = whisper_context_default_params();
     cparams.use_gpu = params.use_gpu;
     struct whisper_context * ctx = whisper_init_from_file_with_params(params.model.c_str(), cparams);
     // init audio
index c92e9e05ef04b2d730dc20df55fc830704a02475..6ece0a7ab0385903fed024ae181e02dcc4e5c17d 100644 (file)
@@ -890,7 +890,7 @@ int main(int argc, char ** argv) {
 
     // whisper init
 
-    struct whisper_context_params cparams;
+    struct whisper_context_params cparams = whisper_context_default_params();
     cparams.use_gpu = params.use_gpu;
 
     struct whisper_context * ctx = whisper_init_from_file_with_params(params.model.c_str(), cparams);
index 4cfc2946fa9d302ea98fe1edee4626a5d4b4cf0b..b11f44f2c6d73dfe24ea5d39b6a53cfba387c91c 100644 (file)
@@ -122,8 +122,7 @@ bool is_file_exist(const char *fileName)
     return infile.good();
 }
 
-void whisper_print_usage(int /*argc*/, char ** argv, const whisper_params & params,
-                         const server_params& sparams) {
+void whisper_print_usage(int /*argc*/, char ** argv, const whisper_params & params, const server_params& sparams) {
     fprintf(stderr, "\n");
     fprintf(stderr, "usage: %s [options] \n", argv[0]);
     fprintf(stderr, "\n");
@@ -525,7 +524,7 @@ int main(int argc, char ** argv) {
         check_ffmpeg_availibility();
     }
     // whisper init
-    struct whisper_context_params cparams;
+    struct whisper_context_params cparams = whisper_context_default_params();
     cparams.use_gpu = params.use_gpu;
 
     struct whisper_context * ctx = whisper_init_from_file_with_params(params.model.c_str(), cparams);
index 47f1780b4ea0f0d9ca26daabe9c0b53edf0ffae7..afdc04ae5f55fbb86660e35497a0043657174bc2 100644 (file)
@@ -166,7 +166,7 @@ int main(int argc, char ** argv) {
         exit(0);
     }
 
-    struct whisper_context_params cparams;
+    struct whisper_context_params cparams = whisper_context_default_params();
     cparams.use_gpu = params.use_gpu;
 
     struct whisper_context * ctx = whisper_init_from_file_with_params(params.model.c_str(), cparams);
index 8942a3fc788eb079f244867724bca230ea861f27..9f18a39a2cce18f4e5e29d6ab913aae722d69bab 100644 (file)
@@ -281,7 +281,7 @@ int main(int argc, char ** argv) {
 
     // whisper init
 
-    struct whisper_context_params cparams;
+    struct whisper_context_params cparams = whisper_context_default_params();
     cparams.use_gpu = params.use_gpu;
 
     struct whisper_context * ctx_wsp = whisper_init_from_file_with_params(params.model_wsp.c_str(), cparams);
index cdb1a230b7d6655fb649a4a6f6cc7909fb3e7a3a..f9de3048669e90c7646149a925a143ae56b3c84a 100644 (file)
@@ -184,7 +184,7 @@ int main(int argc, char ** argv) {
     }
 
     // whisper init
-    struct whisper_context_params cparams;
+    struct whisper_context_params cparams = whisper_context_default_params();
     cparams.use_gpu = params.use_gpu;
 
     struct whisper_context * ctx_wsp = whisper_init_from_file_with_params(params.model_wsp.c_str(), cparams);
index 88771b4adc5e9026ea9a37682b6a3d58db91139f..f66b1765f5b3011eabad13dcb5fbfc57b7feb2e6 100644 (file)
@@ -182,7 +182,7 @@ int main(int argc, char ** argv) {
 
     // whisper init
 
-    struct whisper_context_params cparams;
+    struct whisper_context_params cparams = whisper_context_default_params();
     cparams.use_gpu = params.use_gpu;
 
     struct whisper_context * ctx = whisper_init_from_file_with_params(params.model.c_str(), cparams);