Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -96,7 +96,8 @@ def m2(que, image):
|
|
96 |
input_ids = torch.tensor(input_ids).unsqueeze(0)
|
97 |
|
98 |
generated_ids = model3.generate(pixel_values=pixel_values, input_ids=input_ids, max_length=50)
|
99 |
-
return processor3.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
|
|
100 |
|
101 |
def m3(que, image):
|
102 |
# processor3 = DonutProcessor.from_pretrained("naver-clova-ix/donut-base-finetuned-docvqa")
|
|
|
96 |
input_ids = torch.tensor(input_ids).unsqueeze(0)
|
97 |
|
98 |
generated_ids = model3.generate(pixel_values=pixel_values, input_ids=input_ids, max_length=50)
|
99 |
+
return processor3.batch_decode(generated_ids, skip_special_tokens=True)[0].split('?', 1)[-1].strip()
|
100 |
+
|
101 |
|
102 |
def m3(que, image):
|
103 |
# processor3 = DonutProcessor.from_pretrained("naver-clova-ix/donut-base-finetuned-docvqa")
|