Pass **kwargs in "generate" function instead of passing each argument by name #236
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of wrapping the huggingface generate by copying each argument, it might be better to pass the arguments dynamically -- thus, when the underlying generate API changes, or more features are added, we can take advantage of them directly (instead of having to continue wrapping the arguments). This also gives users more flexibility to override the arguments.
The only default that I noticed was different from the default arguments in huggingface is open_flamingo sets
top_k=0
instead oftop_k=50
. If we want to maintain parity with the existing code, we could easily overwrite this, but it might be better to just have the default arguments be in parity with the huggingface arguments.The only downside to this I can see is that we lose some nice auto-completions in text editors, but I think this tradeoff is worth it.
Testing: