Langchain-Chatchat
Langchain-Chatchat copied to clipboard
[BUG] 上传文件失败:PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。
问题描述 / Problem Description webui中,点击上传并加载知识库时报错。上传docx文件失败。
复现问题的步骤 / Steps to Reproduce 1、 执行 python .\webui.py 2、浏览器中打开界面 3、键入新建知识库名称test 4、上传word文档 5、 点击上传并加载知识库
预期的结果 / Expected Result 顺利上传并加载知识库
实际结果 / Actual Result Error 后台log看到:
Traceback (most recent call last): File "C:\Users\liwenju\anaconda3\envs\langchat\lib\shutil.py", line 791, in move os.rename(src, real_dst) PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\Users\liwenju\AppData\Local\Temp\testpwb_fqr1.docx' -> 'G:\langchain-ChatGLM\content\test\testpwb_fqr1.docx'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\liwenju\anaconda3\envs\langchat\lib\site-packages\gradio\routes.py", line 292, in run_predict output = await app.blocks.process_api( File "C:\Users\liwenju\anaconda3\envs\langchat\lib\site-packages\gradio\blocks.py", line 1007, in process_api result = await self.call_function(fn_index, inputs, iterator, request) File "C:\Users\liwenju\anaconda3\envs\langchat\lib\site-packages\gradio\blocks.py", line 848, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\liwenju\anaconda3\envs\langchat\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\liwenju\anaconda3\envs\langchat\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Users\liwenju\anaconda3\envs\langchat\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File ".\webui.py", line 124, in get_vector_store shutil.move(file.name, os.path.join(UPLOAD_ROOT_PATH, vs_id, filename)) File "C:\Users\liwenju\anaconda3\envs\langchat\lib\shutil.py", line 812, in move os.unlink(src) PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\Users\liwenju\AppData\Local\Temp\testpwb_fqr1.docx'
环境信息 / Environment Information
- langchain-ChatGLM 版本 2023年4月15号
- 是否使用 Docker 部署(是/否):否
- 使用的模型(ChatGLM-6B / ClueAI/ChatYuan-large-v2 等):ChatGLM-6B-int4
- 使用的 Embedding 模型(GanymedeNil/text2vec-large-chinese 等):text2vec-large-chinese
- 操作系统及版本 windows10 专业版
- Python 版本 3.8
同有此问题,经过重新pip install -r requirements.txt解决,估计是gradio版本问题。供后来者参考。
可能你之前上传过,里面有记录,同一份文件拷贝份新的然后上传就可以了,我这边目前是这样解决的
重新装了还是那个版本,为啥问题就解决了?