In the declaration of the method extract_hidden_states in section Transformers as Feature Extractors subsection Extracting the last hidden states, the inclusion of the line if k in tokenizer.model_input_names is not explained in the text. This unexplained line is also a deviation from the previous code demonstrating the behavior of extracting the hidden state for a single line of text. So it tripped me up, personally.
Information
The question or comment is about chapter:
Question or comment
In the declaration of the method
extract_hidden_states
in sectionTransformers as Feature Extractors
subsectionExtracting the last hidden states
, the inclusion of the lineif k in tokenizer.model_input_names
is not explained in the text. This unexplained line is also a deviation from the previous code demonstrating the behavior of extracting the hidden state for a single line of text. So it tripped me up, personally.