Open MichaelOcampo1104 opened 4 months ago
Have you solved this yet?
do you use nougat
or predict.py
?
I found a hacky way of solving it by adding del model_kwargs['cache_position']
into venv/lib/python3.12/site-packages/transformers/generation/utils.py
after line 2390 which should be model_kwargs = self._get_initial_cache_position(input_ids, model_kwargs)
then using predict.py
such as predict.py sample_pdf -o output/
python version Python 3.12.2
transformers==4.41.1 pytorch-lightning==2.2.5 torch==2.3.0 torchmetrics==1.4.0.post0 torchvision==0.18.0
this is an issue with pypdfium2.PdfDocument
not being closed
i am using nougat in colab and it gives this error "Cannot close object, library is destroyed. This may cause a memory leak!" is there a way of solving or to use nougat but using predict.py i have no experience with coding
do you use
nougat
orpredict.py
?I found a hacky way of solving it by adding
del model_kwargs['cache_position']
intovenv/lib/python3.12/site-packages/transformers/generation/utils.py
then usingpredict.py
Additional Information
python version Python 3.12.2
transformers==4.41.1 pytorch-lightning==2.2.5 torch==2.3.0 torchmetrics==1.4.0.post0 torchvision==0.18.0
could you please explain in details how you use predict.py
Have you solved this yet?
did u find a solution to this problem
Try:
pip install transformers==4.38.2
do you use
nougat
orpredict.py
? I found a hacky way of solving it by addingdel model_kwargs['cache_position']
intovenv/lib/python3.12/site-packages/transformers/generation/utils.py
then usingpredict.py
Additional Information
python version Python 3.12.2 transformers==4.41.1 pytorch-lightning==2.2.5 torch==2.3.0 torchmetrics==1.4.0.post0 torchvision==0.18.0
could you please explain in details how you use predict.py @shadi007 Here is a sample cli command i use
predict.py sample_pdf -o output/
Also i will add more information in my first reponse.
This is a problem using the Transformer with versions later than 4.38.2.
working fine previously however recently, Im getting no ouputs with message -> Cannot close object, library is destroyed. This may cause a memory leak!, im using a colab notebook