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,