Spaces:
Build error

jskinner215 commited on
Commit
414bc96
·
1 Parent(s): 512f2de

Still getting tokenization and chunking errors

Browse files

Errors:
The error Token indices sequence length is longer than the specified maximum sequence length for this model (5183 > 512) clearly indicates that the tokenized sequence length is exceeding the model's limit, which is 512 tokens for TAPAS.

The exception ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length. suggests that you should enable truncation to cut the token sequence down to a manageable size.

Fix:
Enable truncation in the tokenizer.
Possibly reduce the chunk size if the above step doesn't resolve the issue.

Notice the truncation=True argument in the tokenizer method. This will truncate the token sequence to fit the model's maximum input size. Also, I've included a try-except block to capture any exceptions that may occur during tokenization.

1 file changed +6 -1
app.py+6-1