LangChain集成Chroma调用from_documents时触发0xC0000005访问违例错误求助
LangChain集成Chroma调用from_documents时触发0xC0000005访问违例错误求助
我现在被这个问题难住了——之前这段代码运行完全正常,但克隆新仓库并重新安装所有依赖后,就开始报错了。错误发生在调用Chroma.from_documents的环节,抛出了0xC0000005访问违例的退出码,这个问题真的很难排查。
我的代码片段
chunks = [] for path in file_paths: # path is a string filepath to a csv chunks.extend(self.chunk_data(path)) chunks = filter_complex_metadata(chunks) # add all relevant documents to chunks # creates a unique cache for this dataset cache_dir_name = "local_cache" if not os.path.exists(cache_dir_name): os.makedirs(cache_dir_name) self.vector_store = Chroma.from_documents(documents=chunks, embedding=FastEmbedEmbeddings(model_name="BAAI/bge-small-en", cache_dir=cache_dir_name)) # 报错发生在这里
触发的错误信息
当代码执行到最后一行时,会抛出如下错误:
Fetching 5 files: 0%| | 0/5 [00:00<?, ?it/s]C:\Users\...\venv\Lib\site-packages\huggingface_hub\file_download.py:140: UserWarning: `huggingface_hub` cache-system uses symlinks by default to efficiently store duplicated files but your machine does not support them in C:\Users\...\cache\models--Qdrant--bge-small-en. Caching files will still work but in a degraded version that might require more space on your disk. This warning can be disabled by setting the `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable. To support symlinks on Windows, you either need to activate Developer Mode or to run Python as an administrator. warnings.warn(message) Fetching 5 files: 100%|██████████| 5/5 [00:05<00:00, 1.18s/it] Process finished with exit code -1073741819 (0xC0000005)
已尝试的操作
我查了下,0xC0000005是访问违例错误,之后我按照提示开启了Windows开发者模式,但重新运行后还是在同一个位置抛出相同的退出码,只是没有了之前的警告信息。
备注:内容来源于stack exchange,提问作者Null Salad




