fix: resolve HuggingFace version alias in image URI tag#5722
Open
giangle-AI wants to merge 2 commits intoaws:masterfrom
Open
fix: resolve HuggingFace version alias in image URI tag#5722giangle-AI wants to merge 2 commits intoaws:masterfrom
giangle-AI wants to merge 2 commits intoaws:masterfrom
Conversation
When constructing the image URI tag for HuggingFace framework containers, the code used `original_version` (the raw user input, e.g. "4.49") instead of resolving it through the version alias mapping (e.g. "4.49" → "4.49.0"). This caused image URIs to contain truncated transformer versions like `transformers4.49` instead of the correct `transformers4.49.0`, resulting in references to non-existent container images. Use `_version_for_config(version, config)` to properly resolve the version alias before embedding it in the image tag. Made-with: Cursor
- Fix existing test_retrieve_huggingface assertions to expect resolved versions (4.2.1) instead of raw aliases (4.2) in image tags - Add parametrized test covering all 25 version aliases across training and inference scopes to verify aliases resolve correctly in tags - Add parametrized test covering all 26 non-aliased (full) versions to confirm no regression when passing complete version strings directly Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
original_version(raw user input like"4.49") instead of resolving it through the version alias mapping ("4.49"→"4.49.0"). This produced incorrect image tags such astransformers4.49instead of the correcttransformers4.49.0, pointing to non-existent container images._version = original_versionwith_version = _version_for_config(version, config)on line 247 ofimage_uris.pyso the version alias is properly resolved before being embedded in the image tag.Before (broken)
After (fixed)
Test plan
transformers4.49in the tag)transformers4.49.0in the tag)image_uris.retrievewith HuggingFace framework4.37,4.51) also resolve correctlyBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.