Spaces:
Sleeping
Sleeping
vad : remove shortform for --vad option in cli.cpp (#3145)
Browse filesThis commit removes the shortform for the --vad option in cli.cpp.
The motivation for this is that `-v` is often used for verbose or
version is many tools and this might cause confusion.
Refs: https://github.com/ggml-org/whisper.cpp/pull/3065#issuecomment-2873243334
- examples/cli/cli.cpp +2 -2
examples/cli/cli.cpp
CHANGED
|
@@ -197,7 +197,7 @@ static bool whisper_params_parse(int argc, char ** argv, whisper_params & params
|
|
| 197 |
else if ( arg == "--grammar-rule") { params.grammar_rule = ARGV_NEXT; }
|
| 198 |
else if ( arg == "--grammar-penalty") { params.grammar_penalty = std::stof(ARGV_NEXT); }
|
| 199 |
// Voice Activity Detection (VAD)
|
| 200 |
-
else if (arg == "
|
| 201 |
else if (arg == "-vm" || arg == "--vad-model") { params.vad_model = ARGV_NEXT; }
|
| 202 |
else if (arg == "-vt" || arg == "--vad-threshold") { params.vad_threshold = std::stof(ARGV_NEXT); }
|
| 203 |
else if (arg == "-vsd" || arg == "--vad-min-speech-duration-ms") { params.vad_min_speech_duration_ms = std::stoi(ARGV_NEXT); }
|
|
@@ -276,7 +276,7 @@ static void whisper_print_usage(int /*argc*/, char ** argv, const whisper_params
|
|
| 276 |
fprintf(stderr, " --grammar-penalty N [%-7.1f] scales down logits of nongrammar tokens\n", params.grammar_penalty);
|
| 277 |
// Voice Activity Detection (VAD) parameters
|
| 278 |
fprintf(stderr, "\nVoice Activity Detection (VAD) options:\n");
|
| 279 |
-
fprintf(stderr, "
|
| 280 |
fprintf(stderr, " -vm FNAME, --vad-model FNAME [%-7s] VAD model path\n", params.vad_model.c_str());
|
| 281 |
fprintf(stderr, " -vt N, --vad-threshold N [%-7.2f] VAD threshold for speech recognition\n", params.vad_threshold);
|
| 282 |
fprintf(stderr, " -vspd N, --vad-min-speech-duration-ms N [%-7d] VAD min speech duration (0.0-1.0)\n", params.vad_min_speech_duration_ms);
|
|
|
|
| 197 |
else if ( arg == "--grammar-rule") { params.grammar_rule = ARGV_NEXT; }
|
| 198 |
else if ( arg == "--grammar-penalty") { params.grammar_penalty = std::stof(ARGV_NEXT); }
|
| 199 |
// Voice Activity Detection (VAD)
|
| 200 |
+
else if ( arg == "--vad") { params.vad = true; }
|
| 201 |
else if (arg == "-vm" || arg == "--vad-model") { params.vad_model = ARGV_NEXT; }
|
| 202 |
else if (arg == "-vt" || arg == "--vad-threshold") { params.vad_threshold = std::stof(ARGV_NEXT); }
|
| 203 |
else if (arg == "-vsd" || arg == "--vad-min-speech-duration-ms") { params.vad_min_speech_duration_ms = std::stoi(ARGV_NEXT); }
|
|
|
|
| 276 |
fprintf(stderr, " --grammar-penalty N [%-7.1f] scales down logits of nongrammar tokens\n", params.grammar_penalty);
|
| 277 |
// Voice Activity Detection (VAD) parameters
|
| 278 |
fprintf(stderr, "\nVoice Activity Detection (VAD) options:\n");
|
| 279 |
+
fprintf(stderr, " --vad [%-7s] enable Voice Activity Detection (VAD)\n", params.vad ? "true" : "false");
|
| 280 |
fprintf(stderr, " -vm FNAME, --vad-model FNAME [%-7s] VAD model path\n", params.vad_model.c_str());
|
| 281 |
fprintf(stderr, " -vt N, --vad-threshold N [%-7.2f] VAD threshold for speech recognition\n", params.vad_threshold);
|
| 282 |
fprintf(stderr, " -vspd N, --vad-min-speech-duration-ms N [%-7d] VAD min speech duration (0.0-1.0)\n", params.vad_min_speech_duration_ms);
|