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 modelscopeVerified import paths — ran on the pinned version, not inferred.
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.
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`.
Avoid using these methods. If repository deletion is critical, consult ModelScope documentation for alternative, authenticated methods or use the web interface.
Explicitly pass the `token` parameter to `HubApi` methods or `pipeline` initializations if you wish to override tokens set in environment variables or instance attributes.
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).
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.