Skip to content

Commit f6de000

Browse files
authored
Merge pull request huggingface#1346 from BramVanroy/documentation
Add small note about the output of hidden states (closes huggingface#1332)
2 parents da2e47a + 15749bf commit f6de000

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,10 @@ outputs = model(input_ids, labels=labels)
452452
loss, logits, attentions = outputs
453453
```
454454

455+
### Using hidden states
456+
457+
By enabling the configuration option `output_hidden_states`, it was possible to retrieve the last hidden states of the encoder. In `pytorch-transformers` as well as `transformers` the return value has changed slightly: `all_hidden_states` now also includes the hidden state of the embeddings in addition to those of the encoding layers. This allows users to easily access the embeddings final state.
458+
455459
### Serialization
456460

457461
Breaking change in the `from_pretrained()`method:

0 commit comments

Comments
 (0)