Add config value type converters for numbers and booleans

This commit is contained in:
Cohee
2025-02-20 21:53:48 +02:00
parent 7571552fef
commit 3f03936125
18 changed files with 88 additions and 53 deletions

View File

@ -132,7 +132,7 @@ export async function getPipeline(task, forceModel = '') {
const cacheDir = path.join(globalThis.DATA_ROOT, '_cache');
const model = forceModel || getModelForTask(task);
const localOnly = !getConfigValue('extensions.models.autoDownload', true);
const localOnly = !getConfigValue('extensions.models.autoDownload', true, 'boolean');
console.log('Initializing transformers.js pipeline for task', task, 'with model', model);
const instance = await pipeline(task, model, { cache_dir: cacheDir, quantized: tasks[task].quantized ?? true, local_files_only: localOnly });
tasks[task].pipeline = instance;