模型范围
ModelScope 是一个大型模型和数据集仓库。
让我们加载 ModelScope Embedding 类。
from langchain_community.embeddings import ModelScopeEmbeddings
API 参考:ModelScopeEmbeddings
model_id = "damo/nlp_corom_sentence-embedding_english-base"
embeddings = ModelScopeEmbeddings(model_id=model_id)
text = "This is a test document."
query_result = embeddings.embed_query(text)
doc_results = embeddings.embed_documents(["foo"])