andito HF staff commited on
Commit
2b0ab69
1 Parent(s): 3b6fda1

tokenizer messing smth up

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -53,7 +53,7 @@ def run_example(task_prompt, image, text_input=None):
53
  task=task_prompt,
54
  image_size=(image.width, image.height)
55
  )
56
- return parsed_answer
57
 
58
  def plot_bbox(image, data):
59
  fig, ax = plt.subplots()
@@ -114,7 +114,7 @@ def process_image(image, task_prompt, text_input=None):
114
  if task_prompt == 'Document Visual Question Answering':
115
  task_prompt = '<DocVQA>'
116
  results = run_example(task_prompt, image, text_input)
117
- return results[task_prompt], None
118
  elif task_prompt == 'Caption':
119
  task_prompt = '<CAPTION>'
120
  results = run_example(task_prompt, image)
 
53
  task=task_prompt,
54
  image_size=(image.width, image.height)
55
  )
56
+ return parsed_answer[task_prompt].replace("<pad>", "")
57
 
58
  def plot_bbox(image, data):
59
  fig, ax = plt.subplots()
 
114
  if task_prompt == 'Document Visual Question Answering':
115
  task_prompt = '<DocVQA>'
116
  results = run_example(task_prompt, image, text_input)
117
+ return results, None
118
  elif task_prompt == 'Caption':
119
  task_prompt = '<CAPTION>'
120
  results = run_example(task_prompt, image)