Transformers: Replace `config.output_hidden_states` parameter with function argument `output_hidden_states`

Created on 21 Apr 2020  路  7Comments  路  Source: huggingface/transformers

馃殌 Feature request

Currently the user has to decide whether the model should output the hidden states when she/he creates the config of a model: config.output_hidden_states = True/False. It would be nice if the user can decide this when calling the models forward() / call() with a flag output_hidden_states. This should be done for all TF and PT models that can output hidden states.

A very similar recent change was done for the variable config.output_past -> see PR:https://github.com/huggingface/transformers/pull/3734

Motivation

The user has more flexibility when the hidden states should be output or not.

Your contribution

If someone feels like contributing to the library, this would be a great first PR. I'm very happy to guide the contributor through the PR!

Good First Issue wontfix

Most helpful comment

Okay, no issues @drjosephliu I'll find some other good first issues to solve.

All 7 comments

Hi, @patrickvonplaten I want to take up this issue. Can I move forward with it?

I think this could have side effects for libraries that use config.output_hidden_states, so I'm cc'ing @Timoeller and @brandenchan, because this parameter is used in FARM.

Hi, @patrickvonplaten I want to take up this issue. Can I move forward with it?

That would be great, feel free to open a PR and do a first model. The PR should be very similar to what was done in PR #3734

Hi, @patrickvonplaten as I am new here I might take some time to get acquainted with the codebase and come up with a PR. Is it okay?

Sorry @gaurav-singh1998, I saw this issue was still open so I made a PR for it.

Okay, no issues @drjosephliu I'll find some other good first issues to solve.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings