extract embedding from whisper

#39
by yaoxunxu - opened

Hi, I want to extract the encoder output(embedding layer) from whisper. I can do this by adding an extra attribute in github version, I would like to try on the huggingface version, how can I extract the embedding from whisper in huggingface version

Hey you can set the output_hidden_state to True either in the config or when calling the model's forward. This will allow you to access the encoder_last_hidden_state/ encoder_hidden_states. Refer to the doc for more detail on this! https://huggingface.co/docs/transformers/model_doc/whisper#transformers.WhisperModel.forward.output_hidden_states

ArthurZ changed discussion status to closed

Sign up or log in to comment