mirror of https://github.com/vladmandic/automatic
RUF013 updates
parent
2d81bcdc69
commit
6ab9b7bc62
|
|
@ -83,7 +83,7 @@ def warn_once(msg):
|
|||
warned = True
|
||||
|
||||
class OpenVINOGraphModule(torch.nn.Module):
|
||||
def __init__(self, gm, partition_id, use_python_fusion_cache, model_hash_str: str = None, file_name="", int_inputs=None):
|
||||
def __init__(self, gm, partition_id, use_python_fusion_cache, model_hash_str: str | None = None, file_name="", int_inputs: list | None = None):
|
||||
if int_inputs is None:
|
||||
int_inputs = []
|
||||
super().__init__()
|
||||
|
|
@ -211,7 +211,7 @@ def execute_cached(compiled_model, *args):
|
|||
result = [torch.from_numpy(res[out]) for out in compiled_model.outputs]
|
||||
return result
|
||||
|
||||
def openvino_compile(gm: GraphModule, *example_inputs, model_hash_str: str = None, file_name=""):
|
||||
def openvino_compile(gm: GraphModule, *example_inputs, model_hash_str: str | None = None, file_name=""):
|
||||
core = Core()
|
||||
|
||||
device = get_device()
|
||||
|
|
@ -427,7 +427,7 @@ def openvino_execute_partitioned(gm: GraphModule, *args, executor_parameters=Non
|
|||
return shared.compiled_model_state.partitioned_modules[signature][0](*ov_inputs)
|
||||
|
||||
|
||||
def partition_graph(gm: GraphModule, use_python_fusion_cache: bool, model_hash_str: str = None, file_name="", int_inputs=None):
|
||||
def partition_graph(gm: GraphModule, use_python_fusion_cache: bool, model_hash_str: str | None = None, file_name="", int_inputs=None):
|
||||
if int_inputs is None:
|
||||
int_inputs = []
|
||||
for node in gm.graph.nodes:
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ def get_log():
|
|||
return log
|
||||
|
||||
|
||||
def install_traceback(suppress: list = None):
|
||||
def install_traceback(suppress: list | None = None):
|
||||
if suppress is None:
|
||||
suppress = []
|
||||
width = os.environ.get("SD_TRACEWIDTH", console.width if console else None)
|
||||
|
|
@ -143,7 +143,7 @@ def setup_logging(debug=None, trace=None, filename=None):
|
|||
logging.Logger.trace = partialmethod(logging.Logger.log, logging.TRACE)
|
||||
logging.trace = partial(logging.log, logging.TRACE)
|
||||
|
||||
def exception_hook(e: Exception, suppress=None):
|
||||
def exception_hook(e: Exception, suppress: list | None = None):
|
||||
from rich.traceback import Traceback
|
||||
if suppress is None:
|
||||
suppress = []
|
||||
|
|
|
|||
Loading…
Reference in New Issue