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

[BUG] 上传的txt文档,如果扩展名是大写”TXT“,报错 #1121

Closed
RayYe586 opened this issue Aug 16, 2023 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@RayYe586
Copy link

上传的txt文档,如果扩展名是大写”TXT“,报错:
Traceback (most recent call last):
File "/home/bso/venv/chatglm2_6b_venv/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "/home/bso/src/srcllm/langchain-ChatGLM/webui.py", line 56, in
pages[selected_page]"func"
File "/home/bso/src/srcllm/langchain-ChatGLM/webui_pages/knowledge_base/knowledge_base.py", line 138, in knowledge_base_page
ret = api.upload_kb_doc(f, kb)
File "/home/bso/src/srcllm/langchain-ChatGLM/webui_pages/utils.py", line 491, in upload_kb_doc
return response.json()
File "/home/bso/venv/chatglm2_6b_venv/lib/python3.10/site-packages/httpx/_models.py", line 756, in json
return jsonlib.loads(self.text, **kwargs)
File "/usr/local/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/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)

@RayYe586 RayYe586 added the bug Something isn't working label Aug 16, 2023
@xain
Copy link
Contributor

xain commented Aug 16, 2023

#1128 我提交了一个pr修正了这个问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants