"docs/git@developer.sourcefind.cn:norm/vllm.git" did not exist on "0967102c6de874902d973f0bcb98d48149a8eb49"
Unverified Commit af9ee873 authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

Better error message for transformers dummy (#1306)

parent 8a730645
......@@ -57,6 +57,7 @@ if is_transformers_available():
INDEX_FILE = "diffusion_pytorch_model.bin"
CUSTOM_PIPELINE_FILE_NAME = "pipeline.py"
DUMMY_MODULES_FOLDER = "diffusers.utils"
TRANSFORMERS_DUMMY_MODULES_FOLDER = "transformers.utils"
logger = logging.get_logger(__name__)
......@@ -592,7 +593,10 @@ class DiffusionPipeline(ConfigMixin):
if load_method_name is None:
none_module = class_obj.__module__
if none_module.startswith(DUMMY_MODULES_FOLDER) and "dummy" in none_module:
is_dummy_path = none_module.startswith(DUMMY_MODULES_FOLDER) or none_module.startswith(
TRANSFORMERS_DUMMY_MODULES_FOLDER
)
if is_dummy_path and "dummy" in none_module:
# call class_obj for nice error message of missing requirements
class_obj()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment