mirror of
https://github.com/vndangkhoa/Sys-Arc-Visl.git
synced 2026-04-05 09:27:57 +07:00
fix: wrap image in array for processor batch input
This commit is contained in:
parent
db777363d7
commit
96670cb678
1 changed files with 3 additions and 2 deletions
|
|
@ -95,9 +95,10 @@ export class VisionService {
|
||||||
// Construct prompts using the processor's method (required for Florence-2)
|
// Construct prompts using the processor's method (required for Florence-2)
|
||||||
const prompts = this.processor.construct_prompts(task);
|
const prompts = this.processor.construct_prompts(task);
|
||||||
|
|
||||||
// Pre-process the image and text inputs (image first, prompts second)
|
// Pre-process the image and text inputs
|
||||||
|
// Processor expects batch input, so wrap single image in array
|
||||||
if (!this.processor) throw new Error('Processor is undefined');
|
if (!this.processor) throw new Error('Processor is undefined');
|
||||||
const inputs = await this.processor(image, prompts);
|
const inputs = await this.processor([image], prompts);
|
||||||
|
|
||||||
const generatedIds = await this.model.generate({
|
const generatedIds = await this.model.generate({
|
||||||
...inputs,
|
...inputs,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue