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