From cc74967a54654befeac1ce88d4d046bea1411b71 Mon Sep 17 00:00:00 2001 From: SysVis AI Date: Sun, 28 Dec 2025 20:30:57 +0700 Subject: [PATCH] fix: use object args for vision processor --- src/lib/visionService.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/visionService.ts b/src/lib/visionService.ts index 8ab0064..a49e64f 100644 --- a/src/lib/visionService.ts +++ b/src/lib/visionService.ts @@ -91,8 +91,10 @@ export class VisionService { // Task: Detailed Captioning is best for understanding diagrams const text = ''; - // Pass image as an array to ensure it's iterable for transformers.js preprocessing - const inputs = await this.processor([image], text); + // Pass arguments as object to avoid positional ambiguity + // Florence-2 processor typically expects 'images' and 'text' + if (!this.processor) throw new Error('Processor is undefined'); + const inputs = await this.processor({ text, images: [image] }); const generatedIds = await this.model.generate({ ...inputs,