1
0
Fork 0

apply lint

This commit is contained in:
Sean Sube 2023-03-16 18:35:30 -05:00
parent 959798eabb
commit f4c0c52029
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 8 additions and 5 deletions

View File

@ -129,7 +129,9 @@ def blend_loras(
up_weight.shape,
alpha,
)
weights = torch.nn.functional.conv2d(down_weight.permute(1, 0, 2, 3), up_weight).permute(1, 0, 2, 3)
weights = torch.nn.functional.conv2d(
down_weight.permute(1, 0, 2, 3), up_weight
).permute(1, 0, 2, 3)
np_weights = weights.numpy() * (alpha / dim)
else:
logger.warning(

View File

@ -38,11 +38,11 @@ def addLoggingLevel(levelName, levelNum, methodName=None):
methodName = levelName.lower()
if hasattr(logging, levelName):
raise AttributeError('{} already defined in logging module'.format(levelName))
raise AttributeError("{} already defined in logging module".format(levelName))
if hasattr(logging, methodName):
raise AttributeError('{} already defined in logging module'.format(methodName))
raise AttributeError("{} already defined in logging module".format(methodName))
if hasattr(logging.getLoggerClass(), methodName):
raise AttributeError('{} already defined in logger class'.format(methodName))
raise AttributeError("{} already defined in logger class".format(methodName))
# This method was inspired by the answers to Stack Overflow post
# http://stackoverflow.com/q/2183233/2988730, especially
@ -50,6 +50,7 @@ def addLoggingLevel(levelName, levelNum, methodName=None):
def logForLevel(self, message, *args, **kwargs):
if self.isEnabledFor(levelNum):
self._log(levelNum, message, args, **kwargs)
def logToRoot(message, *args, **kwargs):
logging.log(levelNum, message, *args, **kwargs)
@ -65,6 +66,6 @@ try:
with open(logging_path, "r") as f:
config_logging = safe_load(f)
dictConfig(config_logging)
addLoggingLevel('TRACE', logging.DEBUG - 5)
addLoggingLevel("TRACE", logging.DEBUG - 5)
except Exception as err:
print("error loading logging config: %s" % (err))