Langchain-Chatchat icon indicating copy to clipboard operation
Langchain-Chatchat copied to clipboard

ValidationError: 1 validation error for HuggingFaceEmbeddings model_kwargs extra fields not permitted (type=value_error.extra)

Open cristianohello opened this issue 1 year ago • 4 comments

ValidationError: 1 validation error for HuggingFaceEmbeddings model_kwargs extra fields not permitted (type=value_error.extra)

Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:12<00:00, 1.62s/it] ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /root/autodl-tmp/chatglm20220419/langchain-ChatGLM-master/cli_demo.py:19 in │ │ │ │ 16 │ │ 17 if name == "main": │ │ 18 │ local_doc_qa = LocalDocQA() │ │ ❱ 19 │ local_doc_qa.init_cfg(llm_model=LLM_MODEL, │ │ 20 │ │ │ │ │ │ embedding_model=EMBEDDING_MODEL, │ │ 21 │ │ │ │ │ │ embedding_device=EMBEDDING_DEVICE, │ │ 22 │ │ │ │ │ │ llm_history_len=LLM_HISTORY_LEN, │ │ │ │ /root/autodl-tmp/chatglm20220419/langchain-ChatGLM-master/chains/local_doc_qa.py:53 in init_cfg │ │ │ │ 50 │ │ │ │ │ │ │ use_ptuning_v2=use_ptuning_v2) │ │ 51 │ │ self.llm.history_len = llm_history_len │ │ 52 │ │ │ │ ❱ 53 │ │ self.embeddings = HuggingFaceEmbeddings(model_name=embedding_model_dict[embeddin │ │ 54 │ │ │ │ │ │ │ │ │ │ │ │ model_kwargs={'device': embedding_device │ │ 55 │ │ # self.embeddings.client = sentence_transformers.SentenceTransformer(self.embedd │ │ 56 │ │ # device=embe │ │ │ │ /root/miniconda3/envs/chatglm20230401/lib/python3.9/site-packages/langchain/embeddings/huggingfa │ │ ce.py:35 in init │ │ │ │ 32 │ │ │ 33 │ def init(self, **kwargs: Any): │ │ 34 │ │ """Initialize the sentence_transformer.""" │ │ ❱ 35 │ │ super().init(**kwargs) │ │ 36 │ │ try: │ │ 37 │ │ │ import sentence_transformers │ │ 38 │ │ │ │ /root/autodl-tmp/chatglm20220419/langchain-ChatGLM-master/pydantic/main.py:342 in │ │ pydantic.main.BaseModel.init │ │ │ │ [Errno 2] No such file or directory: │ │ '/root/autodl-tmp/chatglm20220419/langchain-ChatGLM-master/pydantic/main.py' │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ValidationError: 1 validation error for HuggingFaceEmbeddings model_kwargs extra fields not permitted (type=value_error.extra)

cristianohello avatar Apr 26 '23 09:04 cristianohello