Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
aac7b0d2
Unverified
Commit
aac7b0d2
authored
Dec 07, 2022
by
Younes Belkada
Committed by
GitHub
Dec 07, 2022
Browse files
[Trainer] add error when passing `8bit`models (#20651)
* add error when passing `8bit`models * fix * improve message
parent
d151a8c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
src/transformers/trainer.py
src/transformers/trainer.py
+7
-0
No files found.
src/transformers/trainer.py
View file @
aac7b0d2
...
@@ -357,6 +357,13 @@ class Trainer:
...
@@ -357,6 +357,13 @@ class Trainer:
else
:
else
:
self
.
is_model_parallel
=
False
self
.
is_model_parallel
=
False
# At this stage the model is already loaded
if
getattr
(
model
,
"is_loaded_in_8bit"
,
False
):
raise
ValueError
(
"The model you want to train is loaded in 8-bit precision. "
"Training an 8-bit model is not supported yet. "
)
# Setup Sharded DDP training
# Setup Sharded DDP training
self
.
sharded_ddp
=
None
self
.
sharded_ddp
=
None
if
len
(
args
.
sharded_ddp
)
>
0
:
if
len
(
args
.
sharded_ddp
)
>
0
:
...
...
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