ybelkada commited on
Commit
62dad9a
1 Parent(s): 26b9e85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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, 0)
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