我运行chatglm.py时会输出
{'prompt': ' 感冒发烧怎么引起的?', 'history': []}
{"detail":"Method Not Allowed"}
且运行main.py时会输出
问题:
如何预防感冒
回答:
查询结果错误
docs\第十六章-感染性疾病.docx:
docs\第十六章-感染性疾病.docx:
docs\第十六章-感染性疾病.docx:
docs\第二十三章-儿童保健.docx:
如果改为data = requests.get(" http://127.0.0.1:7860", json=D, headers={"Content-Type": "application/json"})
在运行main.py时会报错
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\ProgramData\Anaconda3\envs\py39\lib\json__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\ProgramData\Anaconda3\envs\py39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\ProgramData\Anaconda3\envs\py39\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\Administrator\Desktop\LangChainTest-main\main.py", line 53, in
res = qa(query)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 149, in call
raise e
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 143, in call
self._call(inputs, run_manager=run_manager)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\retrieval_qa\base.py", line 120, in _call
answer = self.combine_documents_chain.run(
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 270, in run
return self(kwargs, callbacks=callbacks, tags=tags)[self.output_keys[0]]
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 149, in call
raise e
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 143, in call
self._call(inputs, run_manager=run_manager)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\combine_documents\base.py", line 84, in _call
output, extra_return_dict = self.combine_docs(
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\combine_documents\stuff.py", line 87, in combine_docs
return self.llm_chain.predict(callbacks=callbacks, inputs), {}
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\llm.py", line 218, in predict
return self(kwargs, callbacks=callbacks)[self.output_key]
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 149, in call
raise e
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 143, in call
self._call(inputs, run_manager=run_manager)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\llm.py", line 74, in _call
response = self.generate([inputs], run_manager=run_manager)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\llm.py", line 84, in generate
return self.llm.generate_prompt(
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\llms\base.py", line 139, in generate_prompt
return self.generate(prompt_strings, stop=stop, callbacks=callbacks, kwargs)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\llms\base.py", line 203, in generate
raise e
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\llms\base.py", line 195, in generate
self._generate(
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\llms\base.py", line 495, in _generate
else self._call(prompt, stop=stop, **kwargs)
File "C:\Users\Administrator\Desktop\LangChainTest-main\ChatGLM.py", line 38, in _call
resp = response.json()
File "C:\ProgramData\Anaconda3\envs\py39\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)
我运行chatglm.py时会输出 {'prompt': ' 感冒发烧怎么引起的?', 'history': []} {"detail":"Method Not Allowed"} 且运行main.py时会输出
如果改为data = requests.get(" http://127.0.0.1:7860", json=D, headers={"Content-Type": "application/json"}) 在运行main.py时会报错 Traceback (most recent call last): File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\requests\models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "C:\ProgramData\Anaconda3\envs\py39\lib\json__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\ProgramData\Anaconda3\envs\py39\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\ProgramData\Anaconda3\envs\py39\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\Administrator\Desktop\LangChainTest-main\main.py", line 53, in
res = qa(query)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 149, in call
raise e
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 143, in call
self._call(inputs, run_manager=run_manager)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\retrieval_qa\base.py", line 120, in _call
answer = self.combine_documents_chain.run(
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 270, in run
return self(kwargs, callbacks=callbacks, tags=tags)[self.output_keys[0]]
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 149, in call
raise e
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 143, in call
self._call(inputs, run_manager=run_manager)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\combine_documents\base.py", line 84, in _call
output, extra_return_dict = self.combine_docs(
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\combine_documents\stuff.py", line 87, in combine_docs
return self.llm_chain.predict(callbacks=callbacks, inputs), {}
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\llm.py", line 218, in predict
return self(kwargs, callbacks=callbacks)[self.output_key]
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 149, in call
raise e
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\base.py", line 143, in call
self._call(inputs, run_manager=run_manager)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\llm.py", line 74, in _call
response = self.generate([inputs], run_manager=run_manager)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\chains\llm.py", line 84, in generate
return self.llm.generate_prompt(
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\llms\base.py", line 139, in generate_prompt
return self.generate(prompt_strings, stop=stop, callbacks=callbacks, kwargs)
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\llms\base.py", line 203, in generate
raise e
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\llms\base.py", line 195, in generate
self._generate(
File "C:\ProgramData\Anaconda3\envs\py39\lib\site-packages\langchain\llms\base.py", line 495, in _generate
else self._call(prompt, stop=stop, **kwargs)
File "C:\Users\Administrator\Desktop\LangChainTest-main\ChatGLM.py", line 38, in _call
resp = response.json()
File "C:\ProgramData\Anaconda3\envs\py39\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)