Skip to content

Enabling the retrieval of whisper's hidden states#1751

Merged
Adel-Moumen merged 3 commits into
speechbrain:developfrom
Hguimaraes:whisper_hidden_states
Dec 28, 2022
Merged

Enabling the retrieval of whisper's hidden states#1751
Adel-Moumen merged 3 commits into
speechbrain:developfrom
Hguimaraes:whisper_hidden_states

Conversation

@Hguimaraes

Copy link
Copy Markdown
Contributor

Hello guys,

I'm trying to extend the Whisper class to enable the retrieval of the Hidden States. I think it is handy for people working with speech representation learning. It is a small change. Also, I tried to make it compatible with the previous version, so it should not break any examples or codes that are already using this class.

Best regards,
Heitor

@Adel-Moumen Adel-Moumen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Many thanks for the PR!

I left one comment on the naming of the variable + docstring. After that, I think everything is LGTM.

Comment thread speechbrain/lobes/models/huggingface_whisper.py Outdated
Comment thread speechbrain/lobes/models/huggingface_whisper.py Outdated
Comment thread speechbrain/lobes/models/huggingface_whisper.py
@Hguimaraes

Copy link
Copy Markdown
Contributor Author

Hi @Adel-Moumen,

Please let me know if there is anything else I could do on this PR. I think I have answered the previous questions and the interface is similar to the wav2vec2 class.

Best regards,

@Adel-Moumen

Copy link
Copy Markdown
Collaborator

Hi @Adel-Moumen,

Please let me know if there is anything else I could do on this PR. I think I have answered the previous questions and the interface is similar to the wav2vec2 class.

Best regards,

Hello @Hguimaraes,

I will finish the review this week :-)

@Adel-Moumen Adel-Moumen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Thanks again for your great work! Please take a look at my latest comments :-)

Btw, I wish you a great end of the year :-)

Comment thread speechbrain/lobes/models/huggingface_whisper.py

if self.output_all_hiddens:
logits, attn = self.forward_decoder(
out_encoder[-1, ...], decoder_input_ids

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding, out_encoder[-1, ...] is exactly the same as out_encoder[-1], so why adding "..." ?

@Hguimaraes

Copy link
Copy Markdown
Contributor Author

Hi @Adel-Moumen,

Implemented the changes. If there is anything else, just let me know, and I can update it.
I hope you have a great end of the year as well!

Best,

@Adel-Moumen Adel-Moumen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything sounds good! Many thanks for the PR! :-)

@Adel-Moumen Adel-Moumen merged commit ff4366a into speechbrain:develop Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants