pdufour commited on
Commit
fde6d8b
1 Parent(s): 75002d8

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +1 -0
index.js CHANGED
@@ -118,6 +118,7 @@ export async function imageTextToText(
118
 
119
  if (vision) {
120
  let image = await RawImage.fromURL(imagePath);
 
121
  image = image.rgb().toTensor("CHW").to("float32").div_(255.0);
122
  const pixel_values = image.unsqueeze(0);
123
 
 
118
 
119
  if (vision) {
120
  let image = await RawImage.fromURL(imagePath);
121
+ image = await image.resize(INPUT_IMAGE_SIZE[0], INPUT_IMAGE_SIZE[1]);
122
  image = image.rgb().toTensor("CHW").to("float32").div_(255.0);
123
  const pixel_values = image.unsqueeze(0);
124