From 75f46aed2ea9f52af10e2d39274c92a61479d47d Mon Sep 17 00:00:00 2001 From: Mishig Date: Tue, 7 Jul 2026 19:27:43 +0200 Subject: [PATCH] Mock optimum, torchao, gguf for diffusers docs With DIFFUSERS_SLOW_IMPORT=yes (which the shared workflows set), the quantization docs need the quanto/torchao/gguf backends importable. Mocking optimum also sidesteps a diffusers bug in the unavailable path: dummy_optimum_quanto_objects uses backend name "optimum_quanto" while BACKENDS_MAPPING only has "quanto", so requires_backends raises KeyError instead of the intended ImportError. Co-Authored-By: Claude Fable 5 --- src/doc_builder/mock_deps/diffusers.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/doc_builder/mock_deps/diffusers.txt b/src/doc_builder/mock_deps/diffusers.txt index 1de9f4db..32eea71c 100644 --- a/src/doc_builder/mock_deps/diffusers.txt +++ b/src/doc_builder/mock_deps/diffusers.txt @@ -12,3 +12,6 @@ real:pillow real:transformers bitsandbytes real:sentencepiece # kolors tokenizer imports it at module level +optimum # optimum-quanto backend for quantization docs (also avoids diffusers' optimum_quanto/quanto BACKENDS_MAPPING KeyError in the dummy path) +torchao +gguf