How I make pytorch read the numpy format?
I'm trying to create a code with PyTorch and Keras that uses the BERT algorithm to detect fake news, but I got an error tells me: 

can't convert np.ndarray of type numpy.bool_.
The only supported types are: double, float, float16, int64, int32, and uint8.


Please access the code on my Google Codelab. The error can be seen in the last cell. 

The only requirement for running it is downloading a CSV file for the training process.

I can't confirm but I believe your problem will be solved by changing:

train_y = np.array(train_labels) == 'fake'
test_y = np.array(test_labels) == 'fake'


to:

train_y = (np.array(train_labels) == 'fake').astype(int)
test_y = (np.array(test_labels) == 'fake').astype(int)


The train_y data is currently an array of type Bool (True or False) and the tensor needs and int (0 or 1).
