Skip to content

Commit b8fb250

Browse files
authored
Add huggingface license test condition (#5053)
1 parent 7f027bb commit b8fb250

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/dlc_tests/sanity/test_pre_release.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,13 +1078,24 @@ def test_license_file(image):
10781078
pytest.skip("Base DLC has doesn't embed license.txt. Skipping test.")
10791079

10801080
framework, version = get_framework_and_version_from_tag(image)
1081+
10811082
if framework == "autogluon":
10821083
short_version = get_pytorch_version_from_autogluon_image(image)
10831084
# Default to pytorch framework for autogluon since autogluon is built on top of pytorch
10841085
# and uses the same license file structure in S3
10851086
framework = "pytorch"
10861087
else:
10871088
short_version = re.search(r"(\d+\.\d+)", version).group(0)
1089+
1090+
# Huggingface is built on top of DLCs, pointing framework license path to DLC license path
1091+
if "huggingface" in framework:
1092+
if "pytorch" in framework:
1093+
framework = "pytorch"
1094+
elif "tensorflow" in framework:
1095+
framework = "tensorflow"
1096+
else:
1097+
raise Exception(f"Invalid huggingface framework detected: {framework}")
1098+
10881099
LICENSE_FILE_BUCKET = "aws-dlc-licenses"
10891100
local_repo_path = get_repository_local_path()
10901101
container_filename = "CONTAINER_LICENSE_FILE"

0 commit comments

Comments
 (0)