Running on GPU?
## ❓ Questions & Help

Hello, 

I have a straightforward question I think, which I am curious about. 
When I load a pretrained model and use it to tokenise and extract embeddings, is the model running on a GPU or CPU? The reason why I am asking is that using bert is very slow. In particular approximately 100 times slower than the https://pypi.org/project/bert-embedding/ 

Any ideas? 

Cheers,
Dimitar

<!-- A clear and concise description of the question. -->
Hi!

When you're talking about extracting the embeddings using a pre-trained model, what are you talking about exactly?

Are you talking about using the tokenizer like :
```python
tokenizer.encode(text)
```
 which returns the word ids?

Are you talking about using the embedding layer inside the model like :
```python
model.embeddings.word_embeddings(value)
```

Or are you talking about the encoded representation returned by the transformer after a forward pass like
```
model(value)
``` 

For the first one, using the tokenizer, you are simply using a python dictionary so it will run on CPU. For the next two, it depends on where you put your model. If you simply loaded it, it will be on CPU, but if you put in on a specific device using `model.to(device)`, then it will be on the specified device.<|||||>Yes, thank you. I messed up the model. <|||||> summarizer_cnn = pipeline('summarization')
summary_cnn = summarizer_cnn(sum_data)

#where sum_data is a textual data of 1000 length.

When I load a pretrained model and use it to extract summary, the model is running on a CPU instead of CPU and that is the reason bert is very slow. how to run the pretrained model and script on GPU.