merve HF staff commited on
Commit
1869205
1 Parent(s): 96485f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -38,13 +38,12 @@ def predict(image):
38
  outputs = model.generate(
39
  pixel_values.to(device),
40
  min_length=1,
41
- max_new_tokens=30,
42
  bad_words_ids=[[processor.tokenizer.unk_token_id]],
43
  )
44
 
45
- sequence = processor.batch_decode(outputs, skip_special_tokens=True)[0]
46
- sequence = processor.post_process_generation(sequence, fix_markdown=False)
47
- return sequence
48
 
49
 
50
 
 
38
  outputs = model.generate(
39
  pixel_values.to(device),
40
  min_length=1,
 
41
  bad_words_ids=[[processor.tokenizer.unk_token_id]],
42
  )
43
 
44
+ page_sequence = processor.batch_decode(outputs, skip_special_tokens=True)[0]
45
+ page_sequence = processor.post_process_generation(sequence, fix_markdown=False)
46
+ return page_sequence
47
 
48
 
49