Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support for returning the hidden vector in the Wav2Vec2 and Wav2Vec2Bert models#1867

Merged
minhthuc2502 merged 6 commits into
OpenNMT:masterfrom
homink:20250314
Mar 28, 2025
Merged

Support for returning the hidden vector in the Wav2Vec2 and Wav2Vec2Bert models#1867
minhthuc2502 merged 6 commits into
OpenNMT:masterfrom
homink:20250314

Conversation

@homink

@homink homink commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

This PR adds support for returning the hidden vector in the Wav2Vec2 and Wav2Vec2Bert models. By integrating these models into the CTranslate2 framework, this enhancement enables more efficient application in speech encoder tasks, particularly for low-resource systems. To activate this feature, simply add "return_hidden": true, to the config.json. This modification detaches the lm_head during the model conversion and returns the last hidden vector of the model.

@homink

homink commented Mar 14, 2025

Copy link
Copy Markdown
Contributor Author

@minhthuc2502

Copy link
Copy Markdown
Collaborator

Hello, Can you rebase on master to see ìf the pipeline is fixed?

@homink

homink commented Mar 20, 2025

Copy link
Copy Markdown
Contributor Author

@minhthuc2502 all passed indeed. Thank you so much! Would you please merge it?

@minhthuc2502

Copy link
Copy Markdown
Collaborator

Look good to me. Thank you!

@minhthuc2502 minhthuc2502 merged commit 878920e into OpenNMT:master Mar 28, 2025
Lanurence666 pushed a commit to Lanurence666/CTranslate2_backport_py38 that referenced this pull request May 23, 2026
…ert models (OpenNMT#1867)

* adding the hidden vector return feature

* format update

* format update

* dummy

* dummy

---------

Co-authored-by: hkwon <[email protected]>
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