File tree 2 files changed +13
-0
lines changed 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ const whisperParamsMock = {
19
19
no_timestamps : false ,
20
20
audio_ctx : 0 ,
21
21
max_len : 0 ,
22
+ prompt : "" ,
23
+ print_progress : false ,
24
+ progress_callback : ( progress ) => {
25
+ console . log ( `Progress: ${ progress } ` ) ;
26
+ } ,
27
+ max_context : - 1
22
28
} ;
23
29
24
30
describe ( "Run whisper.node" , ( ) => {
Original file line number Diff line number Diff line change @@ -368,6 +368,12 @@ Napi::Value whisper(const Napi::CallbackInfo& info) {
368
368
bool comma_in_time = whisper_params.Get (" comma_in_time" ).As <Napi::Boolean >();
369
369
int32_t max_len = whisper_params.Get (" max_len" ).As <Napi::Number>();
370
370
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
+
371
377
// support prompt
372
378
std::string prompt = " " ;
373
379
if (whisper_params.Has (" prompt" ) && whisper_params.Get (" prompt" ).IsString ()) {
@@ -407,6 +413,7 @@ Napi::Value whisper(const Napi::CallbackInfo& info) {
407
413
params.pcmf32 = pcmf32_vec;
408
414
params.comma_in_time = comma_in_time;
409
415
params.max_len = max_len;
416
+ params.max_context = max_context;
410
417
params.print_progress = print_progress;
411
418
params.prompt = prompt;
412
419
You can’t perform that action at this time.
0 commit comments