You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the zeroshot pipeline with the valhalla/distilbart-mnli-12-9 model. How do I enable multi_class classification? When using the transformer w/ pytorch in python, I pass the argument multi_class=True, but I can't find the appropriate way to do this in Sagemaker. See code below:
from sagemaker.huggingface.model import HuggingFaceModel
# Hub Model configuration. <https://huggingface.co/models>
model = 'valhalla/distilbart-mnli-12-9'
hub = {
'HF_MODEL_ID': model, # model_id from hf.co/models
'HF_TASK':'zero-shot-classification' # NLP task you want to use for predictions,
}
# create Hugging Face Model Class
huggingface_model = HuggingFaceModel(
env=hub, # configuration for loading model from Hub
role=role, # iam role with permissions to create an Endpoint
transformers_version="4.6", # transformers version used
pytorch_version="1.7", # pytorch version used
py_version="py36"
)
# deploy model to SageMaker Inference
predictor = huggingface_model.deploy(
initial_instance_count=1,
instance_type="ml.p2.xlarge",
multi_label= True
)
The text was updated successfully, but these errors were encountered:
I'm using the zeroshot pipeline with the
valhalla/distilbart-mnli-12-9
model. How do I enable multi_class classification? When using the transformer w/ pytorch in python, I pass the argumentmulti_class=True
, but I can't find the appropriate way to do this in Sagemaker. See code below:The text was updated successfully, but these errors were encountered: