tensor type attributes in bert model returned as string
I am new to nlp and i want to build a bert model for sentiment Analysis so i am following this tuto
https://curiousily.com/posts/sentiment-analysis-with-bert-and-hugging-face-using-pytorch-and-python/
but i am getting the error bellow
bert_model = BertModel.from_pretrained(PRE_TRAINED_MODEL_NAME)

last_hidden_state, pooled_output = bert_model(
   input_ids=encoding['input_ids'],
   attention_mask=encoding['attention_mask']
)
last_hidden_state.shape
pooled_output.shape

When i want to execute last_hidden_state.shape I get an error:
'str' object has no attribute 'shape'
why does it return last_hidden_state and pooled_output as str and not tensors.
Thank you.

it seems there was A couple of changes were introduced when the switch from version 3 to version 4 was done in hugging face and can be solved like below
bert_model = BertModel.from_pretrained(PRE_TRAINED_MODEL_NAME, return_dict=False)

