Spaces:
Runtime error
Runtime error
Update app.py
#2
by
ybelkada
- opened
app.py
CHANGED
@@ -153,7 +153,7 @@ processor_deplot = Pix2StructProcessor.from_pretrained("google/deplot")
|
|
153 |
|
154 |
def process_document(image, question):
|
155 |
# image = Image.open(image)
|
156 |
-
inputs = processor_deplot(images=image, text="Generate the underlying data table for the figure below:", return_tensors="pt").to(torch.bfloat16
|
157 |
predictions = model_deplot.generate(**inputs, max_new_tokens=512)
|
158 |
table = processor_deplot.decode(predictions[0], skip_special_tokens=True).replace("<0x0A>", "\n")
|
159 |
|
|
|
153 |
|
154 |
def process_document(image, question):
|
155 |
# image = Image.open(image)
|
156 |
+
inputs = processor_deplot(images=image, text="Generate the underlying data table for the figure below:", return_tensors="pt").to(0, torch.bfloat16)
|
157 |
predictions = model_deplot.generate(**inputs, max_new_tokens=512)
|
158 |
table = processor_deplot.decode(predictions[0], skip_special_tokens=True).replace("<0x0A>", "\n")
|
159 |
|