liuyixin-louis / OpenChatPaper

Yet another paper reading assistant based on OpenAI ChatGPT API. An open-source version that attempts to reimplement ChatPDF. A different dialogue version of another ChatPaper project.
https://huggingface.co/spaces/yixin6178/ChatPaper
BSD 2-Clause "Simplified" License
168 stars 17 forks source link

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

Closed MathiasSong closed 1 year ago

MathiasSong commented 1 year ago

Hello,

I was able to run this app on my local machine (Windows 10). But, after I uploaded a PDF and API key, I am encountering the following error. Would you be able to help me resolve it?

Screenshot 2023-03-29 110909

liuyixin-louis commented 1 year ago

Can you send me the detail messages shown in the terminals?

MathiasSong commented 1 year ago

@liuyixin-louis Thanks for your prompt reply. Here are the messages.


{'pdf_link': './files/20230329_124630_A_Survey_of_EEG_Analysis_based_on_Graph_Neural_Network.pdf', 'user_stamp': '20230329_124630', 'user_query': 'hello'} 2023-03-29 12:46:53.639 Uncaught app exception Traceback (most recent call last): File "C:\Users\matt_song\Anaconda3\envs\open_chat_paper\lib\site-packages\requests\models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "C:\Users\matt_song\Anaconda3\envs\open_chat_paper\lib\json__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\matt_song\Anaconda3\envs\open_chat_paper\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\matt_song\Anaconda3\envs\open_chat_paper\lib\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)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\matt_song\Anaconda3\envs\open_chat_paper\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script exec(code, module.dict) File "C:\Users\matt_song\projects\ai\OpenChatPaper\frontend.py", line 70, in output = response.json() File "C:\Users\matt_song\Anaconda3\envs\open_chat_paper\lib\site-packages\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

liuyixin-louis commented 1 year ago

How is the backend app say?

MathiasSong commented 1 year ago

This is the messages from the backend app.


User 20230330_105745 not in pool, creating new chatpdf [2023-03-30 10:58:15,755] ERROR in app: Exception on /query/ [POST] Traceback (most recent call last): File "C:\Users\matt_song\AppData\Local\anaconda3\envs\openchat\lib\site-packages\flask\app.py", line 2528, in wsgi_app response = self.full_dispatch_request() File "C:\Users\matt_song\AppData\Local\anaconda3\envs\openchat\lib\site-packages\flask\app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\matt_song\AppData\Local\anaconda3\envs\openchat\lib\site-packages\flask\app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\matt_song\AppData\Local\anaconda3\envs\openchat\lib\site-packages\flask\app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "C:\Users\matt_song\projects\ai\OpenChatPaper\backend.py", line 45, in query pdf = GrobidSciPDFPaser( File "C:\Users\matt_song\projects\ai\OpenChatPaper\pdf_parser.py", line 20, in init super().init(db_name=db_name) File "C:\Users\matt_song\projects\ai\OpenChatPaper\base_class.py", line 54, in init with open(db_cache_path, "wb") as cache_file: FileNotFoundError: [Errno 2] No such file or directory: '/app/ckpt/pdf_parser_grobid_scipdf.pkl' 127.0.0.1 - - [30/Mar/2023 10:58:15] "POST /query/ HTTP/1.1" 500 -

liuyixin-louis commented 1 year ago

You need to modify the checkpoint path in windows system.

MathiasSong commented 1 year ago

@liuyixin-louis Could you please let me know which checkpoint path should be modified to what?

liuyixin-louis commented 1 year ago

Any path. Only if there are enough disks to store those checkpoint files.