An integration package connecting ModelScope and LangChain
Project description
langchain-modelscope-integration
This package contains the LangChain integration with ModelScope
Installation
pip install -U langchain-modelscope-integration
Head 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 here.
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?")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_modelscope_integration-0.1.1.tar.gz.
File metadata
- Download URL: langchain_modelscope_integration-0.1.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85137eec300194766653f1efadff3d17630e972c7a81f21872211f6d5b79642b
|
|
| MD5 |
5ab886ed26ef975182585e66092b707a
|
|
| BLAKE2b-256 |
af4e391721915011ce6e1cd3b584f558dd2c262cba90d9390f72c157fb3b16ec
|
File details
Details for the file langchain_modelscope_integration-0.1.1-py3-none-any.whl.
File metadata
- Download URL: langchain_modelscope_integration-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6b4985ec2ac340869c3d2d2d5c7413d91d22f0f3c62a5a26efd20aa4b9ba13d
|
|
| MD5 |
f95ce68a31518b22a427bde360b8236e
|
|
| BLAKE2b-256 |
67670759266bcf37055bf1e65a8a495968064163e0a51239f0a28416838fad47
|