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 authored and Chocobozzz committed Jun 18, 2024
1 parent 5072497 commit 58a8cbc
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 58a8cbc

Please sign in to comment.