From 6c193617e11f417d65bf5bb98b0418886c518c56 Mon Sep 17 00:00:00 2001 From: Vitaly Terentyev Date: Fri, 15 May 2026 14:24:27 +0400 Subject: [PATCH] [Cherrypick] Set torch upper bound to fix ml python test (#38505) --- sdks/python/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdks/python/setup.py b/sdks/python/setup.py index 45781a44c4b1..4c1384c31517 100644 --- a/sdks/python/setup.py +++ b/sdks/python/setup.py @@ -198,7 +198,8 @@ def cythonize(*args, **kwargs): # Drop this cap once transformers updates the CLIP call site to # `cls_token=` or tokenizers reinstates `cls=` as a deprecation alias. 'tokenizers<0.23', - 'torch', + # Avoid torch 2.12.0+ which fails to run unit tests with segfault. + 'torch<2.12.0', # Match tested transformers range. 'transformers>=4.28.0,<4.56.0', # Keep tokenizers compatible with this transformers range.