Skip to content

Commit

Permalink
chore(transcription): setup verbosity based on NODE_ENV value
Browse files Browse the repository at this point in the history
  • Loading branch information
lutangar committed Jun 13, 2024
1 parent e4d089f commit a964899
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export class Ctranslate2Transcriber extends OpenaiTranscriber {
}: WhisperTranscribeArgs): Promise<TranscriptFile> {
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.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ export class OpenaiTranscriber extends AbstractTranscriber {
}: WhisperTranscribeArgs): Promise<TranscriptFile> {
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class WhisperTimestampedTranscriber extends OpenaiTranscriber {
}: WhisperTranscribeArgs): Promise<TranscriptFile> {
this.assertLanguageDetectionAvailable(language)

const $$ = $({ verbose: true })
const $$ = $({ verbose: process.env.NODE_ENV !== 'production' })
const languageArgs = language ? [ '--language', language ] : []

this.createRun(runId)
Expand Down

0 comments on commit a964899

Please sign in to comment.