Skip to content

Commit 347acf8

Browse files
committed
conditionally import diffusers
1 parent 0bbaf4d commit 347acf8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

onnx_diagnostic/torch_models/hghub/hub_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from ...helpers.config_helper import update_config
1111
from . import hub_data_cached_configs
1212
from .hub_data import __date__, __data_tasks__, load_architecture_task, __data_arch_values__
13-
import diffusers
1413

1514

1615
@functools.cache
@@ -127,6 +126,8 @@ def get_pretrained_config(
127126
except ValueError:
128127
# The model might be from diffusers, not transformers.
129128
try:
129+
import diffusers
130+
130131
pipe = diffusers.DiffusionPipeline.from_pretrained(
131132
model_id, trust_remote_code=trust_remote_code, **kwargs
132133
)

0 commit comments

Comments
 (0)