本页还没有译文
本页 12 段还没译成简体中文,下面显示的是英文原文。Modelscope integrations
还没翻译译自英文(docs.langchain.com)本页 12 段都还没译
ModelScope is a big repository of the models and datasets.
This page covers how to use the modelscope ecosystem within LangChain. It is broken into two parts: installation and setup, and then references to specific modelscope wrappers.
Installation
pip install -U langchain-modelscope-integrationuv add langchain-modelscope-integrationHead to ModelScope to sign up to ModelScope and generate an SDK token. Once you've done this set the MODELSCOPE_SDK_TOKEN environment variable:
export MODELSCOPE_SDK_TOKEN=<your_sdk_token>Chat models
ModelScopeChatEndpoint class exposes chat models from ModelScope. See available models in the ModelScope API documentation.
from langchain_modelscope import ModelScopeChatEndpoint
llm = ModelScopeChatEndpoint(model="Qwen/Qwen2.5-Coder-32B-Instruct")
llm.invoke("Sing a ballad of LangChain.")Embeddings
ModelScopeEmbeddings class exposes embeddings from ModelScope.
from langchain_modelscope import ModelScopeEmbeddings
embeddings = ModelScopeEmbeddings(model_id="damo/nlp_corom_sentence-embedding_english-base")
embeddings.embed_query("What is the meaning of life?")LLMs
ModelScopeEndpoint class exposes LLMs from ModelScope.
from langchain_modelscope import ModelScopeEndpoint
llm = ModelScopeEndpoint(model="Qwen/Qwen2.5-Coder-32B-Instruct")
llm.invoke("The meaning of life is")AI 翻译查看英文原文