@@ -252,16 +252,28 @@ def huggingface_pytorch_training_py_version(huggingface_pytorch_training_version
252
252
253
253
@pytest .fixture (scope = "module" )
254
254
def huggingface_training_compiler_pytorch_version (huggingface_training_compiler_version ):
255
- return _huggingface_base_fm_version (
255
+ versions = _huggingface_base_fm_version (
256
256
huggingface_training_compiler_version , "pytorch" , "huggingface_training_compiler"
257
- )[0 ]
257
+ )
258
+ if not versions :
259
+ pytest .skip (
260
+ f"Hugging Face Training Compiler version { huggingface_training_compiler_version } does "
261
+ f"not have a PyTorch release."
262
+ )
263
+ return versions [0 ]
258
264
259
265
260
266
@pytest .fixture (scope = "module" )
261
267
def huggingface_training_compiler_tensorflow_version (huggingface_training_compiler_version ):
262
- return _huggingface_base_fm_version (
268
+ versions = _huggingface_base_fm_version (
263
269
huggingface_training_compiler_version , "tensorflow" , "huggingface_training_compiler"
264
- )[0 ]
270
+ )
271
+ if not versions :
272
+ pytest .skip (
273
+ f"Hugging Face Training Compiler version { huggingface_training_compiler_version } "
274
+ f"does not have a TensorFlow release."
275
+ )
276
+ return versions [0 ]
265
277
266
278
267
279
@pytest .fixture (scope = "module" )
@@ -552,11 +564,6 @@ def _huggingface_base_fm_version(huggingface_version, base_fw, fixture_prefix):
552
564
if len (original_version .split ("." )) == 2 :
553
565
base_fw_version = "." .join (base_fw_version .split ("." )[:- 1 ])
554
566
versions .append (base_fw_version )
555
- if not versions :
556
- pytest .skip (
557
- f"{ fixture_prefix } version { huggingface_version } does not have an"
558
- f" image URI configuration for { base_fw } "
559
- )
560
567
return sorted (versions , reverse = True )
561
568
562
569
0 commit comments