mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-12 04:45:18 +03:00
Co-authored-by: thomas-yanxin <yx20001210@163.com> Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
1.5 KiB
1.5 KiB
In [ ]:
from langchain.embeddings import ModelScopeEmbeddingsIn [ ]:
model_id = "damo/nlp_corom_sentence-embedding_english-base"In [ ]:
embeddings = ModelScopeEmbeddings(model_id=model_id)In [ ]:
text = "This is a test document."In [ ]:
query_result = embeddings.embed_query(text)In [ ]:
doc_results = embeddings.embed_documents(["foo"])