Skip to content

Unify SetTrueOrFalseOrNone and StoreTrueFalseAction#2119

Merged
astachowiczhabana merged 2 commits into
huggingface:v1.19-releasefrom
HabanaAI:unify_args
Jul 9, 2025
Merged

Unify SetTrueOrFalseOrNone and StoreTrueFalseAction#2119
astachowiczhabana merged 2 commits into
huggingface:v1.19-releasefrom
HabanaAI:unify_args

Conversation

@astachowiczhabana
Copy link
Copy Markdown
Collaborator

This pull request simplifies the argument parsing logic in examples/text-generation/run_generation.py by replacing the custom StoreTrueFalseAction class with a new SetTrueOrFalseOrNone action. This change reduces complexity and improves maintainability.

Argument Parsing Simplification:

  • Removed the StoreTrueFalseAction class, which handled boolean and optional values for command-line arguments.
  • Replaced references to StoreTrueFalseAction with SetTrueOrFalseOrNone for several arguments (--flash_attention, --flash_attention_recompute, --flash_attention_causal_mask) to streamline the handling of boolean flags.

astachowiczhabana added a commit to HabanaAI/optimum-habana-fork that referenced this pull request Jul 8, 2025
astachowiczhabana added a commit to HabanaAI/optimum-habana-fork that referenced this pull request Jul 8, 2025
@astachowiczhabana astachowiczhabana self-assigned this Jul 9, 2025
@astachowiczhabana astachowiczhabana merged commit 37b8100 into huggingface:v1.19-release Jul 9, 2025
1 check passed
astachowiczhabana added a commit to HabanaAI/optimum-habana-fork that referenced this pull request Jul 10, 2025
* Unify SetTrueOrFalseOrNone and StoreTrueFalseAction

* Fix style
astachowiczhabana added a commit to HabanaAI/optimum-habana-fork that referenced this pull request Jul 11, 2025
* Unify SetTrueOrFalseOrNone and StoreTrueFalseAction

* Fix style
astachowiczhabana added a commit that referenced this pull request Aug 22, 2025
* Unify SetTrueOrFalseOrNone and StoreTrueFalseAction

* Fix style
astachowiczhabana added a commit that referenced this pull request Aug 25, 2025
* Unify SetTrueOrFalseOrNone and StoreTrueFalseAction

* Fix style
astachowiczhabana added a commit that referenced this pull request Sep 10, 2025
* Unify SetTrueOrFalseOrNone and StoreTrueFalseAction

* Fix style
gplutop7 pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Oct 15, 2025
#371)

* Unify SetTrueOrFalseOrNone and StoreTrueFalseAction

* Fix style

Co-authored-by: Adam Stachowicz <105052242+astachowiczhabana@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants