apply lint
This commit is contained in:
parent
959798eabb
commit
f4c0c52029
|
@ -129,7 +129,9 @@ def blend_loras(
|
||||||
up_weight.shape,
|
up_weight.shape,
|
||||||
alpha,
|
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)
|
np_weights = weights.numpy() * (alpha / dim)
|
||||||
else:
|
else:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
|
|
|
@ -38,11 +38,11 @@ def addLoggingLevel(levelName, levelNum, methodName=None):
|
||||||
methodName = levelName.lower()
|
methodName = levelName.lower()
|
||||||
|
|
||||||
if hasattr(logging, levelName):
|
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):
|
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):
|
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
|
# This method was inspired by the answers to Stack Overflow post
|
||||||
# http://stackoverflow.com/q/2183233/2988730, especially
|
# http://stackoverflow.com/q/2183233/2988730, especially
|
||||||
|
@ -50,6 +50,7 @@ def addLoggingLevel(levelName, levelNum, methodName=None):
|
||||||
def logForLevel(self, message, *args, **kwargs):
|
def logForLevel(self, message, *args, **kwargs):
|
||||||
if self.isEnabledFor(levelNum):
|
if self.isEnabledFor(levelNum):
|
||||||
self._log(levelNum, message, args, **kwargs)
|
self._log(levelNum, message, args, **kwargs)
|
||||||
|
|
||||||
def logToRoot(message, *args, **kwargs):
|
def logToRoot(message, *args, **kwargs):
|
||||||
logging.log(levelNum, message, *args, **kwargs)
|
logging.log(levelNum, message, *args, **kwargs)
|
||||||
|
|
||||||
|
@ -65,6 +66,6 @@ try:
|
||||||
with open(logging_path, "r") as f:
|
with open(logging_path, "r") as f:
|
||||||
config_logging = safe_load(f)
|
config_logging = safe_load(f)
|
||||||
dictConfig(config_logging)
|
dictConfig(config_logging)
|
||||||
addLoggingLevel('TRACE', logging.DEBUG - 5)
|
addLoggingLevel("TRACE", logging.DEBUG - 5)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print("error loading logging config: %s" % (err))
|
print("error loading logging config: %s" % (err))
|
||||||
|
|
Loading…
Reference in New Issue