Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|