I’m (a NLP newbie) trying to use the zero-shot models on a system without a GPU. None of the models seem to work. Can this work without a CPU?
example code:
from transformers import pipeline
classifier = pipeline(“zero-shot-classification”, model=‘joeddav/xlm-roberta-large-xnli’, device=-1)
sequence = “За кого вы голосуете в 2020 году?”
candidate_labels = [“Europe”, “public health”, “politics”]
classifier(sequence, candidate_labels)
output:

~/.local/lib/python3.8/site-packages/torch/cuda/init.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx 5 (Triggered internally at  /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
return torch._C._cuda_getDeviceCount() > 0
Some weights of the model checkpoint at joeddav/xlm-roberta-large-xnli were not used when initializing XLMRobertaForSequenceClassification: [‘roberta.pooler.dense.weight’, ‘roberta.pooler.dense.bias’]

This IS expected if you are initializing XLMRobertaForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
This IS NOT expected if you are initializing XLMRobertaForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).