sujr commited on
Commit
30cce5c
1 Parent(s): 588622e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -9,7 +9,7 @@ processor = Pix2StructProcessor.from_pretrained("sujr/pix2struct-base")
9
  def run(image):
10
  image = Image.fromarray(image)
11
  inputs = processor(images=image, return_tensors="pt")
12
- generated_ids = model.generate(**inputs)
13
  generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
14
 
15
  return generated_text
 
9
  def run(image):
10
  image = Image.fromarray(image)
11
  inputs = processor(images=image, return_tensors="pt")
12
+ generated_ids = model.generate(**inputs, max_new_tokens=100)
13
  generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
14
 
15
  return generated_text