Replace `config.output_hidden_states` parameter with function argument `output_hidden_states`
See original GitHub issue🚀 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!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
change a functions argument's values? - java - Stack Overflow
Consider a slightly different example: public class Test { public static void main(String[] args) { boolean in = false; truifier(in); System.out.println("in ...
Read more >Rest parameters - JavaScript - MDN Web Docs
The rest parameter syntax allows a function to accept an indefinite number of arguments as an array, providing a way to represent variadic ......
Read more >about Functions Advanced Parameters - PowerShell
Explains how to add parameters to advanced functions.
Read more >How To Use *args and **kwargs in Python 3 - DigitalOcean
We can pass a variable number of arguments to a function by using ... and y as function parameters, and instead replacing them...
Read more >Using Python Optional Arguments When Defining Functions
Since functions represent actions, it's a best practice to start your function names with a verb to make your code more readable. Remove...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, no issues @drjosephliu I’ll find some other good first issues to solve.
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.