File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ const whisperParamsMock = {
1919 no_timestamps : false ,
2020 audio_ctx : 0 ,
2121 max_len : 0 ,
22+ prompt : "" ,
23+ print_progress : false ,
24+ progress_callback : ( progress ) => {
25+ console . log ( `Progress: ${ progress } ` ) ;
26+ } ,
27+ max_context : - 1
2228} ;
2329
2430describe ( "Run whisper.node" , ( ) => {
Original file line number Diff line number Diff line change @@ -368,6 +368,12 @@ Napi::Value whisper(const Napi::CallbackInfo& info) {
368368 bool comma_in_time = whisper_params.Get (" comma_in_time" ).As <Napi::Boolean>();
369369 int32_t max_len = whisper_params.Get (" max_len" ).As <Napi::Number>();
370370
371+ // Add support for max_context
372+ int32_t max_context = -1 ;
373+ if (whisper_params.Has (" max_context" ) && whisper_params.Get (" max_context" ).IsNumber ()) {
374+ max_context = whisper_params.Get (" max_context" ).As <Napi::Number>();
375+ }
376+
371377 // support prompt
372378 std::string prompt = " " ;
373379 if (whisper_params.Has (" prompt" ) && whisper_params.Get (" prompt" ).IsString ()) {
@@ -407,6 +413,7 @@ Napi::Value whisper(const Napi::CallbackInfo& info) {
407413 params.pcmf32 = pcmf32_vec;
408414 params.comma_in_time = comma_in_time;
409415 params.max_len = max_len;
416+ params.max_context = max_context;
410417 params.print_progress = print_progress;
411418 params.prompt = prompt;
412419
You can’t perform that action at this time.
0 commit comments