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

JSON Decode error when #84

Open
shumin018 opened this issue Aug 8, 2024 · 3 comments
Open

JSON Decode error when #84

shumin018 opened this issue Aug 8, 2024 · 3 comments

Comments

@shumin018
Copy link

Hello, i've followed the instructions to host llmsherpa on my own resources, but when im trying to access this via an external URL, im getting a json decode error

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

any help please? thanks!

code -

from llmsherpa.readers import LayoutPDFReader
llmsherpa_api_url = 'http://myurl.com/api/parseDocument?renderFormat=all&useNewIndentParser=yes'
pdf_url = "https://abc.xyz/assets/91/b3/3f9213d14ce3ae27e1038e01a0e0/2024q1-alphabet-earnings-release-pdf.pdf"


pdf_reader = LayoutPDFReader(llmsherpa_api_url)
doc = pdf_reader.read_pdf(pdf_url)

@shubhampatwa
Copy link

Check for http://myurl.com nlm-ingestion server, if is working or not.

JSONDecodeError: Expecting value: line 1 column 1 (char 0) arises when server is not working

@emilyweber35
Copy link

I have gotten the same error. Myurl says service is running.

@Quang-elec44
Copy link

I'm having the same issue too. Here is my code

from llmsherpa.readers import LayoutPDFReader

llmsherpa_api_url = "http://localhost:5010/api/document/developer/parseDocument?renderFormat=all"
pdf_url = "myfile.pdf" # also allowed is a file path e.g. /home/downloads/xyz.pdf
pdf_reader = LayoutPDFReader(llmsherpa_api_url)
doc = pdf_reader.read_pdf(pdf_url)

In the container, here is the log:

 * Serving Flask app '__main__'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:5001
 * Running on http://172.17.0.3:5001
Press CTRL+C to quit
172.17.0.1 - - [10/Sep/2024 04:11:06] "POST /api/document/developer/parseDocument?renderFormat=all HTTP/1.1" 404 -

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

4 participants