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
chenpangpang
transformers
Commits
cbadb524
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "b242d0f297aa87a0c8d99657a53691ece2dfe492"
Unverified
Commit
cbadb524
authored
Feb 19, 2021
by
Joe Davison
Committed by
GitHub
Feb 19, 2021
Browse files
Zero shot distillation script cuda patch (#10284)
parent
f1299f50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/research_projects/zero-shot-distillation/distill_classifier.py
...rch_projects/zero-shot-distillation/distill_classifier.py
+1
-1
No files found.
examples/research_projects/zero-shot-distillation/distill_classifier.py
View file @
cbadb524
...
@@ -174,7 +174,7 @@ def get_teacher_predictions(
...
@@ -174,7 +174,7 @@ def get_teacher_predictions(
model
=
AutoModelForSequenceClassification
.
from_pretrained
(
model_path
)
model
=
AutoModelForSequenceClassification
.
from_pretrained
(
model_path
)
model_config
=
model
.
config
model_config
=
model
.
config
if
not
no_cuda
and
torch
.
cuda
.
is_available
():
if
not
no_cuda
and
torch
.
cuda
.
is_available
():
model
=
nn
.
DataParallel
(
model
)
model
=
nn
.
DataParallel
(
model
.
cuda
()
)
batch_size
*=
len
(
model
.
device_ids
)
batch_size
*=
len
(
model
.
device_ids
)
tokenizer
=
AutoTokenizer
.
from_pretrained
(
model_path
,
use_fast
=
use_fast_tokenizer
)
tokenizer
=
AutoTokenizer
.
from_pretrained
(
model_path
,
use_fast
=
use_fast_tokenizer
)
...
...
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