Registry / ai-ml / modelscope

modelscope

JSON →
library1.39.1pypypi✓ verified 24d ago

ModelScope is an open-source model-as-a-service (MaaS) platform from Alibaba Damo Academy, providing a wide range of AI models (vision, NLP, audio, multimodal) for easy deployment and use. It abstracts complex AI model inference into a simple API and offers functionalities for model discovery, download, and fine-tuning. The library is actively developed, with its current version at 1.35.3 and frequent releases.

pip install modelscope
INSTALL
IMPORT
SIG · MODELSCOPE
M
modelscope
ai-mlpythonv1.39.1
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.39.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
1/2 runs
1/2 runs
py 3.11
1/2 runs
1/2 runs
py 3.12
1/2 runs
1/2 runs
py 3.13
1/2 runs
1/2 runs
py 3.9
1/2 runs
1/2 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pipeline
from modelscope import pipeline
from modelscope import pipeline

This quickstart demonstrates how to use ModelScope to perform image classification using a pre-trained model. It initializes a `pipeline` for a specific task and model, then processes an input image from a URL. Models are automatically downloaded and cached locally upon first use. For tasks requiring authentication (e.g., uploading to the Hub or accessing private models), ensure your ModelScope token is set via `os.environ['MS_TOKEN']` or passed explicitly.

import os from modelscope.pipelines import pipeline from modelscope.utils.constant import Tasks # Initialize an image classification pipeline classifier = pipeline(task=Tasks.image_classification, model='damo/cv_resnest50_image-classification_damo') # Example input image URL image_url = 'https://modelscope.cn/api/v1/models/damo/cv_resnest50_image-classification_damo/repo/files/animal.JPEG' # Perform inference result = classifier(image_url) print(f"Image classification result: {result}") # You can also download a model first # from modelscope.hub.snapshot_download import snapshot_download # model_dir = snapshot_download('damo/cv_resnest50_image-classification_damo') # local_classifier = pipeline(task=Tasks.image_classification, model=model_dir) # print(f"Local inference result: {local_classifier(image_url)}")
modelscope --version
Debug
Known issues
breakingThe `ms_dataset` module underwent significant refactoring to align with `datasets` library 4.x. If you're using dataset functionalities, ensure your `datasets` library is updated to version 4.0 or above, or fix potential breaking changes in your code.
fix
Upgrade `datasets` to >=4.0.0 and review usage of `modelscope.msdatasets` for API changes. For example, `from modelscope.datasets` changed to `from modelscope.msdatasets`.
affects: >=1.35.0
deprecatedFor security reasons, `delete_repo`, `delete_model`, and `delete_dataset` methods within the `HubApi` have been temporarily deprecated. Calling these methods will now issue a `DeprecationWarning`.
fix
Avoid using these methods. If repository deletion is critical, consult ModelScope documentation for alternative, authenticated methods or use the web interface.
affects: >=1.34.0
gotchaHub API authentication token priority changed in v1.34.0. The token priority is now: function parameter > instance attribute > environment variable (`MS_TOKEN`). Be explicit if your application relies on a specific token source.
fix
Explicitly pass the `token` parameter to `HubApi` methods or `pipeline` initializations if you wish to override tokens set in environment variables or instance attributes.
affects: >=1.34.0
gotchaUsers encountering `ModuleNotFoundError` for `packaging` or issues with `oss2` (e.g., global import conflicts) in versions prior to 1.35.1 might experience unexpected runtime errors or installation failures.
fix
Upgrade to ModelScope v1.35.1 or later, which includes fixes for these dependency issues. Ensure `packaging` and `oss2` are correctly installed if needed for specific functionalities (e.g., cloud storage interaction).
affects: <1.35.1
gotchaLong-running dataset downloads using OSS (Object Storage Service) previously suffered from STS token expiration issues. This has been addressed, but older versions might still be susceptible.
fix
Upgrade to ModelScope v1.34.0 or later, which includes a refactored OSS utility with automatic temporary credential refresh. This ensures dataset downloads can complete without interruption due to token expiration.
affects: <1.34.0
Upgrade
Version history
1.39.1latest on PyPI · released Aug 4, 2026
Audit
Dependencies
transformersrequiredCore dependency for many NLP models and a common source of compatibility issues, as addressed in multiple releases.
datasetsrequiredCrucial for dataset handling and the `ms_dataset` module, with significant refactoring to support 4.x versions.
torchoptionalOften required as the deep learning backend for many models.
tensorflowoptionalCan be an alternative deep learning backend for some models.
Agent activity
22 hits · last 30 days
node
18
OpenAI (training)
1
Resources