langchain No sentence-transformers model found with name
#24
by
Littlebox692
- opened
# 先将该模型保存在了本地
tokenizer = BertTokenizer.from_pretrained(model_name)
model = BertModel.from_pretrained(model_name)
tokenizer.save_pretrained(save_directory=model_path)
model.save_pretrained(save_directory=model_path)
# 然后使用HuggingFaceEmbedings构建一个对象,这个时候会报警告:No sentence-transformers model found with name xxxxx
embeddings = HuggingFaceEmbeddings(
model_name=local_embeding_model_path,
)
embeddings = SentenceTransformer("shibing624/text2vec-base-chinese",
)