ModelScope
让我们加载 ModelScope Embedding 类。
from langchain.embeddings import ModelScopeEmbeddings
model_id = "damo/nlp_corom_sentence-embedding_english-base"
embeddings = ModelScopeEmbeddings(model_id=model_id)
text = "这是一个测试文档。"
query_result = embeddings.embed_query(text)
doc_results = embeddings.embed_documents(["foo"])