daodao97 / chatdoc

Chat with your doc by openai
457 stars 103 forks source link

今天安装跑不起来了 json.decoder.JSONDecodeError,前天还不会出现此问题 #39

Open alexhmyang opened 1 year ago

alexhmyang commented 1 year ago

你们现在重新装 会报错,以前装的不会 ,应该是 python环境变化了

image

chatdoc-backend | Traceback (most recent call last): chatdoc-backend | File "/data/main.py", line 3, in chatdoc-backend | from doc_util import Doc chatdoc-backend | File "/data/doc_util.py", line 19, in chatdoc-backend | CJKPDFReader = download_loader("CJKPDFReader") chatdoc-backend | File "/usr/local/lib/python3.9/site-packages/llama_index/readers/download.py", line 125, in download_loader chatdoc-backend | library = json.loads(library_raw_content) chatdoc-backend | File "/usr/local/lib/python3.9/json/init.py", line 346, in loads chatdoc-backend | return _default_decoder.decode(s) chatdoc-backend | File "/usr/local/lib/python3.9/json/decoder.py", line 340, in decode chatdoc-backend | raise JSONDecodeError("Extra data", s, end) chatdoc-backend | json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3)

haojieZzz commented 1 year ago

+1

NanJhin commented 1 year ago

++1 兄台最后解决了咩

haojieZzz commented 1 year ago

主要两步:

  1. 升级/server/requirements.txt 中 两个库的版本号为:

    langchain==0.0.154
    llama_index==0.6.15
  2. /server/doc_util.py中 line5 改为如下:

    
    from llama_index import SimpleDirectoryReader, QuestionAnswerPrompt, LLMPredictor, GPTVectorStoreIndex as GPTSimpleVectorIndex
NanJhin commented 1 year ago

谢谢老哥