File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,22 @@ export default async function autoDownloadModel(
4646 logger . debug ( '[Nodejs-whisper] Attempting to compile model...' )
4747 shell . cd ( '../' )
4848
49- const compileCommand = withCuda ? 'WHISPER_CUDA=1 make -j' : 'make -j'
50- const compileResult = shell . exec ( compileCommand )
49+ let compileCommand
50+ if ( process . platform === 'win32' ) {
51+ // Try mingw32-make first
52+ if ( shell . which ( 'mingw32-make' ) ) {
53+ compileCommand = withCuda ? 'WHISPER_CUDA=1 mingw32-make -j' : 'mingw32-make -j'
54+ } else if ( shell . which ( 'make' ) ) {
55+ compileCommand = withCuda ? 'WHISPER_CUDA=1 make -j' : 'make -j'
56+ } else {
57+ throw new Error ( '[Nodejs-whisper] Neither mingw32-make nor make found. Please install MinGW-w64 or MSYS2.' )
58+ }
59+ } else {
60+ compileCommand = withCuda ? 'WHISPER_CUDA=1 make -j' : 'make -j'
61+ }
62+
63+ const compileResult = shell . exec ( compileCommand )
64+
5165
5266 if ( compileResult . code !== 0 ) {
5367 throw new Error ( `[Nodejs-whisper] Failed to compile model: ${ compileResult . stderr } ` )
You can’t perform that action at this time.
0 commit comments