The devices are 0 indexed. So if you have 1 GPU you should use
generator = pipeline('text-generation', model='EleutherAI/gpt-neo-2.7B', device=0)
You can check how many devices are available with torch.cuda.device_count() Then check a specific device with torch.cuda.get_device_name[0]