Files
langchain/docs/extras/integrations/text_embedding/modelscope_hub.ipynb
T
Leonid Ganeline fdba711d28 docs integrations/embeddings consistency (#10302)
Updated `integrations/embeddings`: fixed titles; added links,
descriptions
Updated `integrations/providers`.
2023-09-07 19:53:33 -07:00

1.7 KiB

ModelScope

ModelScope is big repository of the models and datasets.

Let's load the ModelScope Embedding class.

In [ ]:
from langchain.embeddings import ModelScopeEmbeddings
In [ ]:
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"])