Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
Whisper-Finetune_pytorch
Commits
733236e9
Commit
733236e9
authored
Aug 30, 2024
by
Sugon_ldc
Browse files
Update model_utils.py
parent
11dd2295
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
utils/model_utils.py
utils/model_utils.py
+1
-2
No files found.
utils/model_utils.py
View file @
733236e9
import
bitsandbytes
as
bnb
import
torch
from
transformers.trainer_pt_utils
import
LabelSmoother
...
...
@@ -6,7 +5,7 @@ IGNORE_TOKEN_ID = LabelSmoother.ignore_index
def
find_all_linear_names
(
use_8bit
,
model
):
cls
=
bnb
.
nn
.
Linear8bitLt
if
use_8bit
else
torch
.
nn
.
Linear
cls
=
torch
.
nn
.
Linear
lora_module_names
=
set
()
for
name
,
module
in
model
.
named_modules
():
if
isinstance
(
module
,
cls
):
...
...
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