@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 6155bbd1dd
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 5, 11:00 UTC

[Bugfix][Docs] Fix ReadTheDocs build crash from mocked torch decorator (#39284)

Signed-off-by: khluu <khluu000@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Kevin H. Luu committed Apr 8, 2026 at 02:43 UTC 6155bbd1ddd47aeaae2436e32b6518642c22155d
1 file changed +3 -2
docs/mkdocs/hooks/generate_argparse.py
+3 -2
@@ -59,7 +59,7 @@ class PydanticMagicMock(MagicMock):
59 """`MagicMock` that's able to generate pydantic-core schemas."""
60
61 def __init__(self, *args, **kwargs):
62 - name = kwargs.pop("name", None)
62 + name = kwargs.get("name")
63 super().__init__(*args, **kwargs)
64 self.__spec__ = ModuleSpec(name, None)
65
@@ -85,7 +85,8 @@ def auto_mock(module_name: str, attr: str, max_mocks: int = 100):
85 logger.info("Mocking %s for argparse doc generation", e.name)
86 sys.modules[e.name] = PydanticMagicMock(name=e.name)
87 except Exception:
88 - logger.exception("Failed to import %s.%s: %s", module_name, attr)
88 + logger.exception("Failed to import %s.%s", module_name, attr)
89 + raise
90
91 raise ImportError(
92 f"Failed to import {module_name}.{attr} after mocking {max_mocks} imports"