diff --git a/sdks/python/tox.ini b/sdks/python/tox.ini index 52fd82d41153..afb9b6520fb6 100644 --- a/sdks/python/tox.ini +++ b/sdks/python/tox.ini @@ -517,22 +517,17 @@ commands = [testenv:py{310,311}-transformers-{428,447,448,latest}] deps = - # sentence-transformers 2.2.2 is the latest version that supports transformers 4.28.x - 428: sentence-transformers==2.2.2 - 428: transformers>=4.28.0,<4.29.0 - 428: torch>=1.9.0,<1.14.0 - 447: transformers>=4.47.0,<4.48.0 - 447: torch>=1.9.0,<1.14.0 - 455: transformers>=4.55.0,<4.56.0 - 455: torch>=2.0.0,<2.1.0 - latest: transformers>=4.55.0 - latest: torch>=2.0.0 - latest: accelerate>=1.6.0 - tensorflow==2.12.0 - protobuf==4.25.5 - pip==25.0.1 + # Environment dependencies are defined in the `setenv` section and installed in the `commands` section. extras = test,gcp,ml_test -commands = +setenv = + COMMON_DEPS = tensorflow==2.12.0 protobuf==4.25.5 pip==25.0.1 + # sentence-transformers 2.2.2 is the latest version that supports transformers 4.28.x + 428: DEPS = sentence-transformers==2.2.2 'transformers>=4.28.0,<4.29.0' 'torch>=1.9.0,<1.14.0' + 447: DEPS = 'transformers>=4.47.0,<4.48.0' 'torch>=1.9.0,<1.14.0' + 455: DEPS = 'transformers>=4.55.0,<4.56.0' 'torch>=2.0.0,<2.1.0' + latest: DEPS = 'transformers>=4.55.0' 'torch>=2.0.0' 'accelerate>=1.6.0' +commands = + /bin/sh -c "pip install .[{extras}] {env:DEPS} {env:COMMON_DEPS}" # Log transformers and its dependencies version for debugging /bin/sh -c "pip freeze | grep -E transformers" /bin/sh -c "pip freeze | grep -E torch"