You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File /opt/conda/lib/python3.10/site-packages/pydantic/v1/main.py:357, in BaseModel.setattr(self, name, value)
354 return object_setattr(self, name, value)
356 if self.config.extra is not Extra.allow and name not in self.fields:
--> 357 raise ValueError(f'"{self.class.name}" object has no field "{name}"')
358 elif not self.config.allow_mutation or self.config.frozen:
359 raise TypeError(f'"{self.class.name}" is immutable and does not support item assignment')
ValueError: "BCERerank" object has no field "_model"
The text was updated successfully, but these errors were encountered:
代码:
reranker = BCERerank(model="./bce-reranker-base_v1", top_n=5, device='cuda:0')
错误信息:
ValueError Traceback (most recent call last)
Cell In[6], line 39
31 embed_model = HuggingFaceEmbeddings(
32 model_name=embedding_model_name,
33 model_kwargs=embedding_model_kwargs,
34 encode_kwargs=embedding_encode_kwargs
35 )
36 # 创建一个reranker模型
37 # reranker_args = {'model': './bce-reranker-base_v1', 'top_n': 5, 'device': 'cuda:0'}
38 # reranker = BCERerank()
---> 39 reranker = BCERerank(model="./bce-reranker-base_v1", top_n=5, device='cuda:0')
File /mnt/workspace/BCEmbedding/BCEmbedding/tools/langchain/bce_rerank.py:55, in BCERerank.init(self, top_n, model, device, **kwargs)
50 except ImportError:
51 raise ImportError(
52 "Cannot import
BCEmbedding
package,",53 "please
pip install BCEmbedding>=0.1.2
",54 )
---> 55 self._model = RerankerModel(model_name_or_path=model, device=device, **kwargs)
56 super().init(top_n=top_n, model=model)
File /opt/conda/lib/python3.10/site-packages/pydantic/v1/main.py:357, in BaseModel.setattr(self, name, value)
354 return object_setattr(self, name, value)
356 if self.config.extra is not Extra.allow and name not in self.fields:
--> 357 raise ValueError(f'"{self.class.name}" object has no field "{name}"')
358 elif not self.config.allow_mutation or self.config.frozen:
359 raise TypeError(f'"{self.class.name}" is immutable and does not support item assignment')
ValueError: "BCERerank" object has no field "_model"
The text was updated successfully, but these errors were encountered: