1
0
Fork 0

Remove verbose option from transcription

Can be specified on-demand using NODE_DEBUG=execa env variable
This commit is contained in:
Chocobozzz 2024-06-28 08:51:35 +02:00
parent b66963fe6f
commit 0b30e58f6f
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 4 additions and 4 deletions

View file

@ -20,7 +20,7 @@ export class Ctranslate2Transcriber extends OpenaiTranscriber {
}: TranscribeArgs): Promise<TranscriptFile> {
this.assertLanguageDetectionAvailable(language)
const $$ = $({ verbose: process.env.NODE_ENV !== 'production', env: this.getExecEnv() })
const $$ = $({ env: this.getExecEnv() })
if (model.path) {
assert(await lstat(model.path).then(stats => stats.isDirectory()), 'Model path must be a path to a directory.')
@ -56,7 +56,7 @@ export class Ctranslate2Transcriber extends OpenaiTranscriber {
}
async install (directory: string) {
const $$ = $({ verbose: true })
const $$ = $({ verbose: 'full' })
await $$`pip3 install -U -t ${directory} whisper-ctranslate2==${this.engine.version}`
}

View file

@ -18,7 +18,7 @@ export class OpenaiTranscriber extends AbstractTranscriber {
}: TranscribeArgs): Promise<TranscriptFile> {
this.assertLanguageDetectionAvailable(language)
const $$ = $({ verbose: process.env.NODE_ENV !== 'production', env: this.getExecEnv() })
const $$ = $({ env: this.getExecEnv() })
const languageArgs = language ? [ '--language', language ] : []
this.createRun(runId)
@ -64,7 +64,7 @@ export class OpenaiTranscriber extends AbstractTranscriber {
// ---------------------------------------------------------------------------
async install (directory: string) {
const $$ = $({ verbose: true })
const $$ = $({ verbose: 'full' })
await $$`pip3 install -U -t ${[ directory ]} openai-whisper==${this.engine.version}`
}