jpWang / LiLT

Official PyTorch implementation of LiLT: A Simple yet Effective Language-Independent Layout Transformer for Structured Document Understanding (ACL 2022)
MIT License
335 stars 40 forks source link

Cannot load model after weight generation #27

Closed R4ZZ3 closed 1 year ago

R4ZZ3 commented 1 year ago

Hi and thanks for creating this,

I am trying to use https://huggingface.co/Finnish-NLP/roberta-large-finnish-v2?text=Moikka+olen+%3Cmask%3E+kielimalli. with this repo. I have successfully run the weight generation:

python gen_weight_roberta_like.py --lilt lilt-only-base/pytorch_model.bin --text roberta-large-finnish-v2/roberta-large-finnish-v2/pytorch_model.bin --config roberta-large-finnish-v2/roberta-large-finnish-v2/config.json --out lilt-roberta-large-finnish-v2

But when I try to load the model then I get the following error: image

Do you have idea what might cause this and how could it be fixed?

R4ZZ3 commented 1 year ago

Is it ok to use roberta-large models also?

jpWang commented 1 year ago

Hi, due to the limitation of computing resources, we haven't trained the large LiLT model yet. It is considered for future work.

logan-markewich commented 1 year ago

+1 for training LiLT-Large 👍🏻

AnQueth commented 1 year ago

will this ever be done? I am trying to use LILT but we have some forms that go over the 512 limit and we can't just truncate as the data could be anywhere in the tokens.

logan-markewich commented 1 year ago

@AnQuethit it seems this project is mostly dead in terms of development.

My solution for that was to just tokenize longer documents in chunks with some overlap

The doc_stride parameter in huggingface tokenizer is very useful for this

AnQueth commented 1 year ago

i ran across the stride parameter 30 minutes ago but i haven't figured out how to get around the error it causes. do you have working code with it save me some time lol ?

Couldn't cast array of type list to int64