Comments (4)
已修复
config = LangChainCFG()
application = LangChainApplication(config)
application.source_service.init_source_vector()
from chinese-langchain.
https://huggingface.co/spaces/ChallengeHub/Chinese-LangChain
在线demo也是加载失败
from chinese-langchain.
我也是
from chinese-langchain.
python app.py
No compiled kernel found.
Compiling kernels : /root/.cache/huggingface/modules/transformers_modules/THUDM/chatglm-6b-int4-qe/977d9df4cfae6b7a756e07698483872c5c070eee/quantization_kernels_parallel.c
Compiling gcc -O3 -fPIC -pthread -fopenmp -std=c99 /root/.cache/huggingface/modules/transformers_modules/THUDM/chatglm-6b-int4-qe/977d9df4cfae6b7a756e07698483872c5c070eee/quantization_kernels_parallel.c -shared -o /root/.cache/huggingface/modules/transformers_modules/THUDM/chatglm-6b-int4-qe/977d9df4cfae6b7a756e07698483872c5c070eee/quantization_kernels_parallel.so
Kernels compiled : /root/.cache/huggingface/modules/transformers_modules/THUDM/chatglm-6b-int4-qe/977d9df4cfae6b7a756e07698483872c5c070eee/quantization_kernels_parallel.so
Load kernel : /root/.cache/huggingface/modules/transformers_modules/THUDM/chatglm-6b-int4-qe/977d9df4cfae6b7a756e07698483872c5c070eee/quantization_kernels_parallel.so
Setting CPU quantization kernel threads to 16
Using quantization cache
Applying quantization to glm layers
No sentence-transformers model found with name /root/.cache/torch/sentence_transformers/GanymedeNil_text2vec-large-chinese. Creating a new one with MEAN pooling.
姚明.txt
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /root/Chinese-LangChain/app.py:25 in │
│ │
│ 22 │
│ 23 config = LangChainCFG() │
│ 24 application = LangChainApplication(config) │
│ ❱ 25 application.source_service.init_source_vector() │
│ 26 │
│ 27 │
│ 28 def get_file_list(): │
│ │
│ /root/Chinese-LangChain/clc/source_service.py:39 in init_source_vector │
│ │
│ 36 │ │ │ if doc.endswith('.txt'): │
│ 37 │ │ │ │ print(doc) │
│ 38 │ │ │ │ loader = UnstructuredFileLoader(f'{self.docs_path}/{doc}', mode="element │
│ ❱ 39 │ │ │ │ doc = loader.load() │
│ 40 │ │ │ │ docs.extend(doc) │
│ 41 │ │ self.vector_store = FAISS.from_documents(docs, self.embeddings) │
│ 42 │ │ self.vector_store.save_local(self.vector_store_path) │
│ │
│ /root/miniconda3/lib/python3.8/site-packages/langchain/document_loaders/unstructured.py:61 in │
│ load │
│ │
│ 58 │ │
│ 59 │ def load(self) -> List[Document]: │
│ 60 │ │ """Load file.""" │
│ ❱ 61 │ │ elements = self._get_elements() │
│ 62 │ │ if self.mode == "elements": │
│ 63 │ │ │ docs: List[Document] = list() │
│ 64 │ │ │ for element in elements: │
│ │
│ /root/miniconda3/lib/python3.8/site-packages/langchain/document_loaders/unstructured.py:93 in │
│ _get_elements │
│ │
│ 90 │ │ super().init(mode=mode, **unstructured_kwargs) │
│ 91 │ │
│ 92 │ def _get_elements(self) -> List: │
│ ❱ 93 │ │ from unstructured.partition.auto import partition │
│ 94 │ │ │
│ 95 │ │ return partition(filename=self.file_path, **self.unstructured_kwargs) │
│ 96 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'unstructured.partition.auto'
root@autodl-container-ebe411a150-49ec68c6:/Chinese-LangChain# python app.py/Chinese-LangChain#
No compiled kernel found.
Compiling kernels : /root/.cache/huggingface/modules/transformers_modules/THUDM/chatglm-6b-int4-qe/977d9df4cfae6b7a756e07698483872c5c070eee/quantization_kernels_parallel.c
Compiling gcc -O3 -fPIC -pthread -fopenmp -std=c99 /root/.cache/huggingface/modules/transformers_modules/THUDM/chatglm-6b-int4-qe/977d9df4cfae6b7a756e07698483872c5c070eee/quantization_kernels_parallel.c -shared -o /root/.cache/huggingface/modules/transformers_modules/THUDM/chatglm-6b-int4-qe/977d9df4cfae6b7a756e07698483872c5c070eee/quantization_kernels_parallel.so
Kernels compiled : /root/.cache/huggingface/modules/transformers_modules/THUDM/chatglm-6b-int4-qe/977d9df4cfae6b7a756e07698483872c5c070eee/quantization_kernels_parallel.so
Load kernel : /root/.cache/huggingface/modules/transformers_modules/THUDM/chatglm-6b-int4-qe/977d9df4cfae6b7a756e07698483872c5c070eee/quantization_kernels_parallel.so
Setting CPU quantization kernel threads to 16
Using quantization cache
Applying quantization to glm layers
No sentence-transformers model found with name /root/.cache/torch/sentence_transformers/GanymedeNil_text2vec-large-chinese. Creating a new one with MEAN pooling.
王治郅.txt
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /root/Chinese-LangChain/app.py:36 in │
│ │
│ 33 │
│ 34 │
│ 35 file_list = get_file_list() │
│ ❱ 36 application.source_service.init_source_vector() │
│ 37 │
│ 38 def upload_file(file): │
│ 39 │ if not os.path.exists("docs"): │
│ │
│ /root/Chinese-LangChain/clc/source_service.py:39 in init_source_vector │
│ │
│ 36 │ │ │ if doc.endswith('.txt'): │
│ 37 │ │ │ │ print(doc) │
│ 38 │ │ │ │ loader = UnstructuredFileLoader(f'{self.docs_path}/{doc}', mode="element │
│ ❱ 39 │ │ │ │ doc = loader.load() │
│ 40 │ │ │ │ docs.extend(doc) │
│ 41 │ │ self.vector_store = FAISS.from_documents(docs, self.embeddings) │
│ 42 │ │ self.vector_store.save_local(self.vector_store_path) │
│ │
│ /root/miniconda3/lib/python3.8/site-packages/langchain/document_loaders/unstructured.py:61 in │
│ load │
│ │
│ 58 │ │
│ 59 │ def load(self) -> List[Document]: │
│ 60 │ │ """Load file.""" │
│ ❱ 61 │ │ elements = self._get_elements() │
│ 62 │ │ if self.mode == "elements": │
│ 63 │ │ │ docs: List[Document] = list() │
│ 64 │ │ │ for element in elements: │
│ │
│ /root/miniconda3/lib/python3.8/site-packages/langchain/document_loaders/unstructured.py:93 in │
│ _get_elements │
│ │
│ 90 │ │ super().init(mode=mode, **unstructured_kwargs) │
│ 91 │ │
│ 92 │ def _get_elements(self) -> List: │
│ ❱ 93 │ │ from unstructured.partition.auto import partition │
│ 94 │ │ │
│ 95 │ │ return partition(filename=self.file_path, **self.unstructured_kwargs) │
│ 96 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'unstructured.partition.auto'
root@autodl-container-ebe411a150-49ec68c6:
from chinese-langchain.
Related Issues (20)
- 我在main.py中引入三方包不成功
- 如何将文本转为向量知识库 HOT 2
- python main.py报错,请问如何解决 HOT 4
- 5秒报错
- RuntimeError: Internal: src/sentencepiece_processor.cc(1101) [model_proto->ParseFromArray(serialized.data(), serialized.size())]
- ModuleNotFoundError: No module named 'transformers_modules.' HOT 1
- 如果询问编程问题,给出的回答界面就是一片白茫茫 HOT 1
- BadZipFile: File is not a zip file
- 希望取得联系
- 有体验的渠道吗 HOT 1
- 是否支持使用int4模型并且只通过CPU运行?想本机尝试一下
- web searching 功能
- embedding_model_name设置已下载好的text2vec-large-chinese路径,怎么不对呢
- 上传文档,文档内容有什么要求吗
- hugging face demo error
- 运行main.py时遇到报错cannot import name 'ddg' from 'duckduckgo_search' HOT 3
- 写到第2个问题时遇到报错“TypeError:列表索引必须是整数或切片,而不是str” HOT 1
- 加载中文维基百科数据要多久
- 安装了必要的库,但是运行报错,是transformers版本问题嘛? HOT 3
- 请问回复的时候支持流式展示么 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chinese-langchain.