LlamaIndex Embedding Integration: ModelScope
Installation
To install the required package, run:
!pip install llama-index-embeddings-modelscope
Basic Usage
Initialize the ModelScopeLLM
To use the ModelScopeEmbedding model, create an instance by specifying the model name and revision:
from llama_index.embeddings.modelscope.base import ModelScopeEmbedding
model = ModelScopeEmbedding(
model_name="iic/nlp_gte_sentence-embedding_chinese-base",
model_revision="master",
)
Generate Embedding
To generate a text embedding for a query, use the get_query_embedding method or get_text_embedding method:
rsp = model.get_query_embedding("Hello, who are you?")
print(rsp)
rsp = model.get_text_embedding("Hello, who are you?")
print(rsp)
Generate Batch Embedding
To generate a text embedding for a batch of text, use the get_text_embedding_batch method:
rsp = model.get_text_embedding_batch(
["Hello, who are you?", "I am a student."]
)
print(rsp)
Metadata
Release files for llama-index-embeddings-modelscope 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| llama_index_embeddings_modelscope-0.7.0.tar.gz | 3.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_embeddings_modelscope-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / llama_index_embeddings_modelscope-0.7.0.tar.gz
| Download URL | llama_index_embeddings_modelscope-0.7.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4e22493e3eea643ee43455b5885e82767de75ab29c2af455d28b928a32b9feb
|
|
BLAKE2b-256 checksum How to use checksums |
d7ba0264bcba5e65418775f932922eb8c634fbd9f03d03c08c582b48c748627f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / llama_index_embeddings_modelscope-0.7.0-py3-none-any.whl
| Download URL | llama_index_embeddings_modelscope-0.7.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c3208c2d59ba0a92fe22d3bcaab64e19f3037a13aad500a9a402a63cedd63ba2
|
|
BLAKE2b-256 checksum How to use checksums |
ccb3074258a093cc9cb352f2669af0d9c00cb8cf8c94c91bff1493d4fcdadb72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for llama-index-embeddings-modelscope 0.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.