Open hoangminhtoan opened 1 year ago
Are you sure you're not mixing hidden_size
and hidden_state
up?
hidden_state
is just the name which is given to the argument passed to the .forward
method in MultiHeadAttention
and it is not used as an attribute of the config
object as far as I can see.
Are you sure you're not mixing
hidden_size
andhidden_state
up?hidden_state
is just the name which is given to the argument passed to the.forward
method inMultiHeadAttention
and it is not used as an attribute of theconfig
object as far as I can see.
The hidden_state`` is called in
.forward(self, hidden_state)in
AttentionHeadclass. I cloned the notebook and then ran the notebook. I'll change the attribute
hidden_stateinto
hidden_size``` to check if the error occurs.
I didn't mean to change hidden_state
into hidden_size
; I meant that as is (and as far as I could experiment) hidden_state
is not used as an attribute of the BertConfig
object (as BertConfig
does not have such an attribute), but rather as an argument to the .forward
methods of both AttentionHead
and MultiHeadAttention
classes, which shouldn't hurt.
This said, I didn't clone and run the notebook directly, therefore I might be wrong.
Information
The question or comment is about chapter:
Question or comment
I got this error when running notebook for Chapter03 on google colab with transformers ver 4.13.0