14
14
15
15
import json
16
16
import os
17
- import pdb
18
17
19
18
import boto3
20
19
import pytest
@@ -193,8 +192,9 @@ def pytorch_inference_py_version(pytorch_inference_version, request):
193
192
194
193
@pytest .fixture (scope = "module" )
195
194
def huggingface_pytorch_training_version (huggingface_training_version ):
196
- return _huggingface_base_fm_version (huggingface_training_version , "pytorch" , "huggingface_training" )[0 ]
197
-
195
+ return _huggingface_base_fm_version (
196
+ huggingface_training_version , "pytorch" , "huggingface_training"
197
+ )[0 ]
198
198
199
199
200
200
@pytest .fixture (scope = "module" )
@@ -386,14 +386,16 @@ def _huggingface_base_fm_version(huggingface_version, base_fw, fixture_prefix):
386
386
387
387
for key in list (version_config .keys ()):
388
388
if key .startswith (base_fw ):
389
- base_fw_version = key [len (base_fw ):]
389
+ base_fw_version = key [len (base_fw ) :]
390
390
if len (original_version .split ("." )) == 2 :
391
391
base_fw_version = "." .join (base_fw_version .split ("." )[:- 1 ])
392
392
versions .append (base_fw_version )
393
393
return versions
394
394
395
395
396
- def _generate_huggingface_base_fw_latest_versions (metafunc , fixture_prefix , huggingface_version , base_fw ):
396
+ def _generate_huggingface_base_fw_latest_versions (
397
+ metafunc , fixture_prefix , huggingface_version , base_fw
398
+ ):
397
399
versions = _huggingface_base_fm_version (huggingface_version , base_fw , fixture_prefix )
398
400
fixture_name = f"{ fixture_prefix } _{ base_fw } _latest_version"
399
401
@@ -414,8 +416,12 @@ def _parametrize_framework_version_fixtures(metafunc, fixture_prefix, config):
414
416
metafunc .parametrize (fixture_name , (latest_version ,), scope = "session" )
415
417
416
418
if "huggingface" in fixture_prefix :
417
- _generate_huggingface_base_fw_latest_versions (metafunc , fixture_prefix , latest_version , "pytorch" )
418
- _generate_huggingface_base_fw_latest_versions (metafunc , fixture_prefix , latest_version , "tensorflow" )
419
+ _generate_huggingface_base_fw_latest_versions (
420
+ metafunc , fixture_prefix , latest_version , "pytorch"
421
+ )
422
+ _generate_huggingface_base_fw_latest_versions (
423
+ metafunc , fixture_prefix , latest_version , "tensorflow"
424
+ )
419
425
420
426
fixture_name = "{}_latest_py_version" .format (fixture_prefix )
421
427
if fixture_name in metafunc .fixturenames :
0 commit comments