return past hidden states when `output_hidden_states` provided
#59
by
noahtren
- opened
The model should be able to return past hidden states, as expected in the forward()
function for HuggingFace models.
Added this because I needed it, but additional support for output_attentions
param could be added.
Hi
@noahtren
, until this PR is merged you can load the model from susnato/phi-2
.
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("susnato/phi-2")
tokenizer = AutoTokenizer.from_pretrained("susnato/phi-2")
This way the phi model on the transformers library will be loaded which has support for output_attentions
.
(BTW make sure you have the latest transformers version installed pip install -U transformers
)
gugarosa
changed pull request status to
closed