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

JSONDecodeError #64

Open
chengyjonathan opened this issue Mar 27, 2024 · 1 comment
Open

JSONDecodeError #64

chengyjonathan opened this issue Mar 27, 2024 · 1 comment

Comments

@chengyjonathan
Copy link

self.pdf_reader = readers.LayoutPDFReader(
self.api_url,
)
document = self.pdf_reader.read_pdf(final_location)

returns

Traceback (most recent call last):
File "", line 1, in
File "", line 21, in read_document
File "/Users/joncheng/opt/miniconda3/envs/owlbear/lib/python3.10/site-packages/llmsherpa/readers/file_reader.py", line 72, in read_pdf
response_json = json.loads(parser_response.data.decode("utf-8"))
File "/Users/joncheng/opt/miniconda3/envs/owlbear/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/Users/joncheng/opt/miniconda3/envs/owlbear/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/joncheng/opt/miniconda3/envs/owlbear/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Looks like there's an issue with handling jsondecoding errors.

I just provided a local file path.

@dalmia
Copy link

dalmia commented Jul 16, 2024

Switching to the docker image for nlm-ingestor in this comment worked for me.

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

2 participants