Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,7 @@ def predict(image):
|
|
38 |
outputs = model.generate(
|
39 |
pixel_values.to(device),
|
40 |
min_length=1,
|
41 |
-
max_new_tokens=
|
42 |
bad_words_ids=[[processor.tokenizer.unk_token_id]],
|
43 |
)
|
44 |
|
@@ -62,7 +62,7 @@ def inference(pdf_file, pdf_link):
|
|
62 |
images = rasterize_paper(file_name, return_pil=True)
|
63 |
sequence = ""
|
64 |
# infer for every page and concat
|
65 |
-
for image in images
|
66 |
sequence += predict(image)
|
67 |
|
68 |
|
|
|
38 |
outputs = model.generate(
|
39 |
pixel_values.to(device),
|
40 |
min_length=1,
|
41 |
+
max_new_tokens=1500,
|
42 |
bad_words_ids=[[processor.tokenizer.unk_token_id]],
|
43 |
)
|
44 |
|
|
|
62 |
images = rasterize_paper(file_name, return_pil=True)
|
63 |
sequence = ""
|
64 |
# infer for every page and concat
|
65 |
+
for image in images:
|
66 |
sequence += predict(image)
|
67 |
|
68 |
|