@imClumsyPanda
我确定是.txt。是不是内容不能有什么特殊符号,比如表情符号??
@imClumsyPanda
est.txt 未能成功加载
.ipynb_checkpoints 未能成功加载
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /root/autodl-tmp/chatglm/langchain-ChatGLM-master/knowledge_based_chatglm.py:114 in │
│ │
│ 111 │ vector_store = None │
│ 112 │ while not vector_store: │
│ 113 │ │ filepath = input("Input your local knowledge file path 请输入本地知识文件路径:" │
│ ❱ 114 │ │ vector_store = init_knowledge_vector_store(filepath) │
│ 115 │ history = [] │
│ 116 │ while True: │
│ 117 │ │ query = input("Input your question 请输入问题:") │
│ │
│ /root/autodl-tmp/chatglm/langchain-ChatGLM-master/knowledge_based_chatglm.py:73 in │
│ init_knowledge_vector_store │
│ │
│ 70 │ │ │ except: │
│ 71 │ │ │ │ print(f"{file} 未能成功加载") │
│ 72 │ │
│ ❱ 73 │ vector_store = FAISS.from_documents(docs, embeddings) │
│ 74 │ return vector_store │
│ 75 │
│ 76 │
│ │
│ /root/miniconda3/envs/chatglm20230401/lib/python3.9/site-packages/langchain/vectorstores/base.py │
│ :116 in from_documents │
│ │
│ 113 │ │ """Return VectorStore initialized from documents and embeddings.""" │
│ 114 │ │ texts = [d.page_content for d in documents] │
│ 115 │ │ metadatas = [d.metadata for d in documents] │
│ ❱ 116 │ │ return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs) │
│ 117 │ │
│ 118 │ @classmethod │
│ 119 │ @abstractmethod │
│ │
│ /root/miniconda3/envs/chatglm20230401/lib/python3.9/site-packages/langchain/vectorstores/faiss.p │
│ y:345 in from_texts │
│ │
│ 342 │ │ │ │ faiss = FAISS.from_texts(texts, embeddings) │
│ 343 │ │ """ │
│ 344 │ │ embeddings = embedding.embed_documents(texts) │
│ ❱ 345 │ │ return cls.__from(texts, embeddings, embedding, metadatas, **kwargs) │
│ 346 │ │
│ 347 │ @classmethod │
│ 348 │ def from_embeddings( │
│ │
│ /root/miniconda3/envs/chatglm20230401/lib/python3.9/site-packages/langchain/vectorstores/faiss.p │
│ y:307 in __from │
│ │
│ 304 │ │ **kwargs: Any, │
│ 305 │ ) -> FAISS: │
│ 306 │ │ faiss = dependable_faiss_import() │
│ ❱ 307 │ │ index = faiss.IndexFlatL2(len(embeddings[0])) │
│ 308 │ │ index.add(np.array(embeddings, dtype=np.float32)) │
│ 309 │ │ documents = [] │
│ 310 │ │ for i, text in enumerate(texts): │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range
@imClumsyPanda
MIME type was application/csv. This file type is not currently supported in unstructured.
test.txt 未能成功加载
我也遇到了,应该是文件里有什么特殊字符。把文字复制粘贴一次临时解决了。
我也遇到了,应该是文件里有什么特殊字符。把文字复制粘贴一次临时解决了。
请问一下这个txt格式有要求吗?
同样遇到这个问题,我甚至不知道是哪里出的问题,因为本文是在太长了,不知道有什么不合规的特殊符号。follow一下这个问题后续
上传文件时什么文件都上传不了报错AxiosError: Request failed with status code 403!这个有什么办法解决吗