fix some gguf loras

This commit is contained in:
layerdiffusion
2024-08-17 01:15:37 -07:00
parent ab4b0d5b58
commit 8a04293430
4 changed files with 16 additions and 5 deletions

View File

@@ -93,6 +93,13 @@ def calculate_parameters(sd, prefix=""):
return params
def tensor2parameter(x):
if isinstance(x, torch.nn.Parameter):
return x
else:
return torch.nn.Parameter(x, requires_grad=False)
def fp16_fix(x):
# An interesting trick to avoid fp16 overflow
# Source: https://github.com/lllyasviel/stable-diffusion-webui-forge/issues/1114