@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / f6af34626d
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 9, 00:00 UTC

Fix offline test for Transformers v5 (#33682)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>

Harry Mellor committed Feb 3, 2026 at 12:07 UTC f6af34626d37f63ecb128e1f775ebcbbc1d0e5bf
1 file changed +7
tests/entrypoints/offline_mode/test_offline_mode.py
+7
@@ -109,8 +109,15 @@ def _re_import_modules():
109 if k.startswith("transformers") and not k.startswith("transformers_modules")
110 ]
111
112 + # These modules are aliased in Transformers v5 and so cannot be reloaded directly
113 + aliased_modules = ["tokenization_utils", "tokenization_utils_fast"]
114 +
115 reload_exception = None
116 for module_name in hf_hub_module_names + transformers_module_names:
117 + if any(module_name.endswith(f".{alias}") for alias in aliased_modules):
118 + # Remove from sys.modules so they are re-aliased on next import
119 + del sys.modules[module_name]
120 + continue
121 try:
122 importlib.reload(sys.modules[module_name])
123 except Exception as e: