microsoft / DeepSpeed-MII

MII makes low-latency and high-throughput inference possible, powered by DeepSpeed.
Apache License 2.0
1.9k stars 175 forks source link

ValueError: Unsupported model type roberta #432

Open pradeepdev-1995 opened 8 months ago

pradeepdev-1995 commented 8 months ago

Tried to load a finetuned roberta model with

import mii
pipe = mii.pipeline("roberta fine-tuned model path")

But it shows error

ValueError: Unsupported model type roberta
mrwyattii commented 7 months ago

Hi @pradeepdev-1995 we list supported models for the latest DeepSpeed-MII here: https://github.com/microsoft/DeepSpeed-MII?tab=readme-ov-file#supported-models

If you want to run a Roberta model, you will need to use the MII-Legacy APIs: https://github.com/microsoft/DeepSpeed-MII/tree/main/mii/legacy

In particular, see this example: https://github.com/microsoft/DeepSpeed-MII/blob/main/mii/legacy/examples/local/question-answering-example.py

pradeepdev-1995 commented 7 months ago

@mrwyattii I tried the following code from the official documentation

import mii
mii_configs = {"tensor_parallel": 1, "dtype": "fp16"}
mii.deploy(task="text-classification",model="roberta-large-mnli",deployment_name="roberta_deployment",mii_config=mii_configs)

But it raises error

text-classification is not supported by roberta-large-mnli. This task is supported by 53415 other models. See which models with `mii.get_supported_models(mii.text-classification)`. (type=assertion_error)

So I tried the mii.get_supported_models(mii.text-classification) command, but it shows

AttributeError: module 'mii' has no attribute 'text'

Package versions using

deepspeed==0.14.0
deepspeed-kernels==0.0.1.dev1698255861
deepspeed-mii==0.2.3