Closed darsh169 closed 3 years ago
Hi Darshan, Nope, It returned a tensor of the shape (batch, seq_length, hidden_dim). Have you tested the code and got a string?
Yeah I got string at first that's why modified it
It must be something wrong on your end, have you used the same huggingface transformer version as specified in the requirement.txt? I'd also suggest that you take a look at the Huggingface documentation, which can clarify what the output of BERT model looks like.
Yeah there is issue with versions Thanks !
No worries, glad that it worked out :)
@hasanhuz.. Just for confirmation.. doesn't line- last_hidden_state, pooler_output = self.bert(input_ids=input_ids) returns last_hidden_state as a string rather than a tensor?