Error on pipeline with docquery

#5
by Sevan-cpu - opened

Hello,

I’ve tried to implement docquery with different models like impira/layoutlm-invoices but I always have the same error (on collab notebook or pycharm, windows or ubuntu always the same):

Code :
from docquery import document, pipeline

p = pipeline(task=‘document-question-answering’, model = “impira/layoutlm-invoices”)
doc = document.load_document(file)
s = p(question=“What is the invoice number?”, **doc.context)

Error :

Exception Traceback (most recent call last)

File ~\Documents\GitHub\Llama\venv\lib\site-packages\transformers\pipelines\pt_utils.py:291, in PipelinePackIterator.next(self)
289 else:
290 item = processed
→ 291 is_last = item.pop(“is_last”)
292 accumulator.append(item)
293 return accumulator

File ~\Documents\GitHub\Llama\venv\lib\site-packages\transformers\utils\generic.py:310, in ModelOutput.pop(self, *args, **kwargs)
309 def pop(self, *args, **kwargs):
→ 310 raise Exception(f"You cannot use pop on a {self.class.name} instance.")

Exception: You cannot use pop on a ModelOutput instance.

Thank you for your help.

Sevan-cpu changed discussion status to closed

Sign up or log in to comment