mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
check for init and call
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -47,7 +47,7 @@ class PipelineBase(TorchCompatibleModule, diffusers.DiffusionPipeline, metaclass
|
||||
|
||||
if "optimum.onnxruntime" in sys.modules:
|
||||
import optimum.onnxruntime
|
||||
if isinstance(module, optimum.onnxruntime.modeling_diffusion._ORTDiffusionModelPart): # pylint: disable=protected-access
|
||||
if isinstance(module, optimum.onnxruntime.modeling_diffusion._ORTDiffusionModelPart): # pylint: disable=protected-access, no-member
|
||||
device = extract_device(args, kwargs)
|
||||
if device is None:
|
||||
return self
|
||||
|
||||
@@ -19,12 +19,14 @@ class NoWatermark:
|
||||
|
||||
|
||||
def get_signature(cls):
|
||||
if cls is None or not hasattr(cls, '__init__'):
|
||||
return {}
|
||||
signature = inspect.signature(cls.__init__, follow_wrapped=True)
|
||||
return signature.parameters
|
||||
|
||||
|
||||
def get_call(cls):
|
||||
if cls is None:
|
||||
if cls is None or not hasattr(cls, '__call__'): # noqa: B004
|
||||
return []
|
||||
signature = inspect.signature(cls.__call__, follow_wrapped=True)
|
||||
return signature.parameters
|
||||
|
||||
Reference in New Issue
Block a user