mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-29 02:31:16 +00:00
fix some gguf loras
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user