Pipeline on GPU

model_name = "gchhablani/bert-base-cased-finetuned-sst2"

model = AutoModelForSequenceClassification.from_pretrained(model_name).to(device)

tokenizer = AutoTokenizer.from_pretrained(model_name)

classifier = pipeline(task='text-classification', model=model,tokenizer=tokenizer,device=0)

input="i"

print(classifier(input))

Having this code i am getting

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!