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

Running the Google Colab throws exception #61

Open
uakel opened this issue Feb 5, 2023 · 1 comment
Open

Running the Google Colab throws exception #61

uakel opened this issue Feb 5, 2023 · 1 comment

Comments

@uakel
Copy link

uakel commented Feb 5, 2023

When running the notebook top to bottom we get following error for the second cell:

document-question-answering is already registered. Overwriting pipeline for task document-question-answering...
2023-02-05 19:28:49,801 ERROR: Failed while processing https://arxiv.org/pdf/2101.07597.pdf on question: 'who authored this paper?'
Traceback (most recent call last):
  File "/usr/local/bin/docquery", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/docquery/cmd/__main__.py", line 61, in main
    return args.func(args)
  File "/usr/local/lib/python3.8/dist-packages/docquery/cmd/scan.py", line 95, in main
    response = nlp(question=q, **d.context)
  File "/usr/local/lib/python3.8/dist-packages/docquery/ext/pipeline_document_question_answering.py", line 232, in __call__
    return super().__call__({"question": question, "pages": normalized_images}, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/transformers/pipelines/base.py", line 1076, in __call__
    return next(
  File "/usr/local/lib/python3.8/dist-packages/transformers/pipelines/pt_utils.py", line 124, in __next__
    item = next(self.iterator)
  File "/usr/local/lib/python3.8/dist-packages/transformers/pipelines/pt_utils.py", line 291, in __next__
    is_last = item.pop("is_last")
  File "/usr/local/lib/python3.8/dist-packages/transformers/utils/generic.py", line 281, in pop
    raise Exception(f"You cannot use ``pop`` on a {self.__class__.__name__} instance.")
Exception: You cannot use ``pop`` on a ModelOutput instance.

I get the same exception when running the following with my local install.

docquery scan "who authored this paper?" https://arxiv.org/pdf/2101.07597.pdf

I would really appreciate a fix, since I'm really curious of trying out docquery

Regards!

@uakel
Copy link
Author

uakel commented Feb 7, 2023

I found the workaround on #60

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

1 participant