-
Notifications
You must be signed in to change notification settings - Fork 27.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: Fix corner-case issue with the important models workflow #30212
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
runs-on: [single-gpu, nvidia-gpu, a10, ci] | ||
container: | ||
image: huggingface/transformers-all-latest-gpu | ||
options: --gpus all --privileged --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ | ||
if: ${{ needs.get_modified_models.outputs.matrix != '[]' && needs.get_modified_models.outputs.matrix != '' }} | ||
if: ${{ needs.get_modified_models.outputs.matrix != '[]' && needs.get_modified_models.outputs.matrix != '' && fromJson(needs.get_modified_models.outputs.matrix)[0] != null }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the most efficient condition i could use, simply converting to an array and trying to access to the first element seemed to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we always going to be able to safely index on 0
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i think so , per my understanding if the array is empty fromJson(needs.get_modified_models.outputs.matrix)[0]
will give null
, so the check fromJson(needs.get_modified_models.outputs.matrix)[0] != null
circumvents the case where the array is empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great - thanks for confirming!
@younesbelkada Could you include in the PR description what the corner case is? I can see this is a fix but it's not clear what 's being addressed |
Thanks @amyeroberts ! Sorry, yes - I just added some description, let me know what do you think - here is also an example of that corner case: https://huggingface.slack.com/archives/C06L2SGMEEA/p1713186513863159 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the info and this fix.
LGTM - just a question on whether we need to protect the indexing at all?
runs-on: [single-gpu, nvidia-gpu, a10, ci] | ||
container: | ||
image: huggingface/transformers-all-latest-gpu | ||
options: --gpus all --privileged --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ | ||
if: ${{ needs.get_modified_models.outputs.matrix != '[]' && needs.get_modified_models.outputs.matrix != '' }} | ||
if: ${{ needs.get_modified_models.outputs.matrix != '[]' && needs.get_modified_models.outputs.matrix != '' && fromJson(needs.get_modified_models.outputs.matrix)[0] != null }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we always going to be able to safely index on 0
here?
Thanks for the review ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worflow is failing eversince this PR
…gface#30212) * Update push-important-models.yml * dummy commit * Update modeling_bark.py * test * test * test * another test * another test * test * final test * final test * test * another test * test * test * another test * test llama * revert everything * remove echo
* Update push-important-models.yml * dummy commit * Update modeling_bark.py * test * test * test * another test * another test * test * final test * final test * test * another test * test * test * another test * test llama * revert everything * remove echo
* Update push-important-models.yml * dummy commit * Update modeling_bark.py * test * test * test * another test * another test * test * final test * final test * test * another test * test * test * another test * test llama * revert everything * remove echo
As per title
Before this PR, there was a bug when `models/xxx files where modified because a check for empty arrays on the GitHub action was being bypassed leading to the action being run unexpectedly such as: https://github.com/huggingface/transformers/actions/runs/8688185234 - this PR fixes it