diff --git a/packages/tests/src/transcription/whisper/transcriber/whisper-ctranslate2.spec.ts b/packages/tests/src/transcription/whisper/transcriber/whisper-ctranslate2.spec.ts index e258378bc79..6ee072a2a70 100644 --- a/packages/tests/src/transcription/whisper/transcriber/whisper-ctranslate2.spec.ts +++ b/packages/tests/src/transcription/whisper/transcriber/whisper-ctranslate2.spec.ts @@ -104,7 +104,6 @@ describe('Whisper CTranslate2 transcriber', function () { this.timeout(5 * 1000 * 60) const transcribeArgs: WhisperTranscribeArgs = { mediaFilePath: frVideoPath, - model: await TranscriptionModel.fromPath(buildAbsoluteFixturePath('transcription/models/tiny.pt')), language: 'fr', format: 'txt' } diff --git a/packages/transcription/src/whisper/transcriber/ctranslate2-transcriber.ts b/packages/transcription/src/whisper/transcriber/ctranslate2-transcriber.ts index d6b858354c7..29801a0d3a6 100644 --- a/packages/transcription/src/whisper/transcriber/ctranslate2-transcriber.ts +++ b/packages/transcription/src/whisper/transcriber/ctranslate2-transcriber.ts @@ -4,6 +4,7 @@ import { lstat } from 'node:fs/promises' import { OpenaiTranscriber, WhisperTranscribeArgs } from './openai-transcriber.js' import { TranscriptFile } from '../../transcript/index.js' import { WhisperBuiltinModel } from '../whisper-builtin-model.js' +import assert from 'node:assert' export class Ctranslate2Transcriber extends OpenaiTranscriber { async transcribe ({ @@ -20,7 +21,7 @@ export class Ctranslate2Transcriber extends OpenaiTranscriber { const $$ = $({ verbose: true }) if (model.path) { - await lstat(model.path).then(stats => stats.isDirectory()) + assert(await lstat(model.path).then(stats => stats.isDirectory()), 'Model path must be a path to a directory.') } const modelArgs = model.path ? [ '--model_directory', model.path ] : [ '--model', model.name ]