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
0d9328f2
Unverified
Commit
0d9328f2
authored
Aug 07, 2020
by
Lysandre Debut
Committed by
GitHub
Aug 07, 2020
Browse files
Patch GPU failures (#6281)
* Pin to 1.5.0 * Patch XLM GPU test
parent
80a0676a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
.github/workflows/self-push.yml
.github/workflows/self-push.yml
+1
-1
src/transformers/modeling_xlm.py
src/transformers/modeling_xlm.py
+3
-1
No files found.
.github/workflows/self-push.yml
View file @
0d9328f2
...
@@ -36,7 +36,7 @@ jobs:
...
@@ -36,7 +36,7 @@ jobs:
run
:
|
run
:
|
source .env/bin/activate
source .env/bin/activate
pip install --upgrade pip
pip install --upgrade pip
pip install torch --no-cache-dir
pip install torch
!=1.6.0
--no-cache-dir
pip install .[sklearn,testing]
pip install .[sklearn,testing]
-
name
:
Are GPUs recognized by our DL frameworks
-
name
:
Are GPUs recognized by our DL frameworks
...
...
src/transformers/modeling_xlm.py
View file @
0d9328f2
...
@@ -496,11 +496,13 @@ class XLMModel(XLMPreTrainedModel):
...
@@ -496,11 +496,13 @@ class XLMModel(XLMPreTrainedModel):
else
:
else
:
bs
,
slen
=
inputs_embeds
.
size
()[:
-
1
]
bs
,
slen
=
inputs_embeds
.
size
()[:
-
1
]
device
=
input_ids
.
device
if
input_ids
is
not
None
else
inputs_embeds
.
device
if
lengths
is
None
:
if
lengths
is
None
:
if
input_ids
is
not
None
:
if
input_ids
is
not
None
:
lengths
=
(
input_ids
!=
self
.
pad_index
).
sum
(
dim
=
1
).
long
()
lengths
=
(
input_ids
!=
self
.
pad_index
).
sum
(
dim
=
1
).
long
()
else
:
else
:
lengths
=
torch
.
LongT
ensor
([
slen
]
*
bs
)
lengths
=
torch
.
t
ensor
([
slen
]
*
bs
,
device
=
device
)
# mask = input_ids != self.pad_index
# mask = input_ids != self.pad_index
# check inputs
# check inputs
...
...
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