Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: piece id is out of range #75

Open
AkshataABhat opened this issue May 28, 2024 · 1 comment
Open

IndexError: piece id is out of range #75

AkshataABhat opened this issue May 28, 2024 · 1 comment

Comments

@AkshataABhat
Copy link

Hi getting this error while running inference:
Reloading the model helps, but it is extremely time consuming.

The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's attention_maskto obtain reliable results. Settingpad_token_idtoeos_token_id`:2 for open-end generation.

IndexError Traceback (most recent call last)
in <cell line: 3>()
1 image='../2-015-000213-1.jpg'
2 query='Extract all the grammatically complete sentences in the invoice.'
----> 3 answer=docowl.inference(image, query)
4 print(answer)

9 frames
/usr/local/lib/python3.10/dist-packages/sentencepiece/init.py in _func(v, n)
1036 def _func(v, n):
1037 if type(n) is int and (n < 0 or n >= v.piece_size()):
-> 1038 raise IndexError('piece id is out of range.')
1039 return func(v, n)
1040

IndexError: piece id is out of range.`

@HAWLYQ
Copy link
Collaborator

HAWLYQ commented May 28, 2024

Hi, @AkshataABhat, I have never met such issues, could you provide this image to me to reproduce this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants