Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
4eb94962
Commit
4eb94962
authored
Feb 19, 2024
by
Kohaku-Blueleaf
Committed by
GitHub
Feb 19, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent undefined variable
parent
5a8dd0c5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
extensions-builtin/Lora/network_oft.py
extensions-builtin/Lora/network_oft.py
+2
-2
No files found.
extensions-builtin/Lora/network_oft.py
View file @
4eb94962
...
@@ -22,6 +22,8 @@ class NetworkModuleOFT(network.NetworkModule):
...
@@ -22,6 +22,8 @@ class NetworkModuleOFT(network.NetworkModule):
self
.
org_module
:
list
[
torch
.
Module
]
=
[
self
.
sd_module
]
self
.
org_module
:
list
[
torch
.
Module
]
=
[
self
.
sd_module
]
self
.
scale
=
1.0
self
.
scale
=
1.0
self
.
is_kohya
=
False
self
.
is_boft
=
False
# kohya-ss
# kohya-ss
if
"oft_blocks"
in
weights
.
w
.
keys
():
if
"oft_blocks"
in
weights
.
w
.
keys
():
...
@@ -31,13 +33,11 @@ class NetworkModuleOFT(network.NetworkModule):
...
@@ -31,13 +33,11 @@ class NetworkModuleOFT(network.NetworkModule):
self
.
dim
=
self
.
oft_blocks
.
shape
[
0
]
# lora dim
self
.
dim
=
self
.
oft_blocks
.
shape
[
0
]
# lora dim
# LyCORIS OFT
# LyCORIS OFT
elif
"oft_diag"
in
weights
.
w
.
keys
():
elif
"oft_diag"
in
weights
.
w
.
keys
():
self
.
is_kohya
=
False
self
.
oft_blocks
=
weights
.
w
[
"oft_diag"
]
self
.
oft_blocks
=
weights
.
w
[
"oft_diag"
]
# self.alpha is unused
# self.alpha is unused
self
.
dim
=
self
.
oft_blocks
.
shape
[
1
]
# (num_blocks, block_size, block_size)
self
.
dim
=
self
.
oft_blocks
.
shape
[
1
]
# (num_blocks, block_size, block_size)
# LyCORIS BOFT
# LyCORIS BOFT
self
.
is_boft
=
False
if
weights
.
w
[
"oft_diag"
]
.
dim
()
==
4
:
if
weights
.
w
[
"oft_diag"
]
.
dim
()
==
4
:
self
.
is_boft
=
True
self
.
is_boft
=
True
self
.
rescale
=
weights
.
w
.
get
(
'rescale'
,
None
)
self
.
rescale
=
weights
.
w
.
get
(
'rescale'
,
None
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment