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
OmniSQL_pytorch
Commits
14b50ed0
Commit
14b50ed0
authored
Apr 18, 2025
by
mashun1
Browse files
Update train.py
parent
d6cb6066
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
train_and_evaluate/train.py
train_and_evaluate/train.py
+2
-2
No files found.
train_and_evaluate/train.py
View file @
14b50ed0
...
@@ -126,7 +126,7 @@ def train(opt):
...
@@ -126,7 +126,7 @@ def train(opt):
# enable gradient checkpointing to save GPU memory, but this action would slowdown the training speed 20-30%.
# enable gradient checkpointing to save GPU memory, but this action would slowdown the training speed 20-30%.
# in addition, gradient_checkpointing can not be enabled when using deepspeed ZERO-3
# in addition, gradient_checkpointing can not be enabled when using deepspeed ZERO-3
model
.
gradient_checkpointing_enable
()
model
.
gradient_checkpointing_enable
()
model
.
enable_input_require_grads
()
dataset
=
SFTDataset
(
opt
.
sft_data_dir
,
tokenizer
,
opt
.
block_size
,
opt
.
mode
)
dataset
=
SFTDataset
(
opt
.
sft_data_dir
,
tokenizer
,
opt
.
block_size
,
opt
.
mode
)
if
accelerator
.
is_main_process
:
if
accelerator
.
is_main_process
:
sanity_check
(
dataset
[
0
][
"input_ids"
],
dataset
[
0
][
"labels"
],
tokenizer
)
sanity_check
(
dataset
[
0
][
"input_ids"
],
dataset
[
0
][
"labels"
],
tokenizer
)
...
@@ -207,4 +207,4 @@ def train(opt):
...
@@ -207,4 +207,4 @@ def train(opt):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
opt
=
parse_option
()
opt
=
parse_option
()
train
(
opt
)
train
(
opt
)
\ No newline at end of file
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