diff --git a/packages/transcription/src/whisper/transcriber/ctranslate2-transcriber.ts b/packages/transcription/src/whisper/transcriber/ctranslate2-transcriber.ts index 29801a0d3a63..01b9739a3355 100644 --- a/packages/transcription/src/whisper/transcriber/ctranslate2-transcriber.ts +++ b/packages/transcription/src/whisper/transcriber/ctranslate2-transcriber.ts @@ -16,9 +16,7 @@ export class Ctranslate2Transcriber extends OpenaiTranscriber { }: WhisperTranscribeArgs): Promise { this.assertLanguageDetectionAvailable(language) - // Shall we run the command with `{ shell: true }` to get the same error as in sh ? - // ex: ENOENT => Command not found - const $$ = $({ verbose: true }) + const $$ = $({ verbose: process.env.NODE_ENV !== 'production' }) if (model.path) { assert(await lstat(model.path).then(stats => stats.isDirectory()), 'Model path must be a path to a directory.') diff --git a/packages/transcription/src/whisper/transcriber/openai-transcriber.ts b/packages/transcription/src/whisper/transcriber/openai-transcriber.ts index 961700fcb710..5d9a7ce856a8 100644 --- a/packages/transcription/src/whisper/transcriber/openai-transcriber.ts +++ b/packages/transcription/src/whisper/transcriber/openai-transcriber.ts @@ -20,9 +20,7 @@ export class OpenaiTranscriber extends AbstractTranscriber { }: WhisperTranscribeArgs): Promise { this.assertLanguageDetectionAvailable(language) - // Shall we run the command with `{ shell: true }` to get the same error as in sh ? - // ex: ENOENT => Command not found - const $$ = $({ verbose: true }) + const $$ = $({ verbose: process.env.NODE_ENV !== 'production' }) const languageArgs = language ? [ '--language', language ] : [] this.createRun(runId) diff --git a/packages/transcription/src/whisper/transcriber/timestamped-transcriber.ts b/packages/transcription/src/whisper/transcriber/timestamped-transcriber.ts index d6d376d7b32b..fcdd33eb1a07 100644 --- a/packages/transcription/src/whisper/transcriber/timestamped-transcriber.ts +++ b/packages/transcription/src/whisper/transcriber/timestamped-transcriber.ts @@ -18,7 +18,7 @@ export class WhisperTimestampedTranscriber extends OpenaiTranscriber { }: WhisperTranscribeArgs): Promise { this.assertLanguageDetectionAvailable(language) - const $$ = $({ verbose: true }) + const $$ = $({ verbose: process.env.NODE_ENV !== 'production' }) const languageArgs = language ? [ '--language', language ] : [] this.createRun(runId)