Configure model path for all libraries
Some checks failed
Publish Library / Tag Version (push) Has been cancelled
Publish Library / Build NPM Project (push) Has been cancelled

This commit is contained in:
2025-12-22 11:02:24 -05:00
parent bb6933f0d5
commit 3cd7b12f5f
3 changed files with 5 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ export class Audio {
async downloadAsrModel(model: string = this.whisperModel): Promise<string> {
if(!this.ai.options.whisper?.binary) throw new Error('Whisper not configured');
if(!model.endsWith('.bin')) model += '.bin';
const p = Path.join(this.ai.options.whisper.path, model);
const p = Path.join(this.ai.options.path, model);
if(await fs.stat(p).then(() => true).catch(() => false)) return p;
if(!!this.downloads[model]) return this.downloads[model];
this.downloads[model] = fetch(`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/${model}`)