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
9261c7f7
Commit
9261c7f7
authored
Jan 07, 2020
by
Morgan Funtowicz
Browse files
Remove f-string device creation on PyTorch GPU pipelines.
Signed-off-by:
Morgan Funtowicz
<
morgan@huggingface.co
>
parent
91d33c79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/pipelines.py
src/transformers/pipelines.py
+1
-1
No files found.
src/transformers/pipelines.py
View file @
9261c7f7
...
...
@@ -335,7 +335,7 @@ class Pipeline(_ScikitCompat):
self
.
tokenizer
=
tokenizer
self
.
modelcard
=
modelcard
self
.
framework
=
framework
self
.
device
=
device
if
framework
==
"tf"
else
torch
.
device
(
"cpu"
if
device
<
0
else
f
"cuda:
{
device
}
"
)
self
.
device
=
device
if
framework
==
"tf"
else
torch
.
device
(
"cpu"
if
device
<
0
else
"cuda:{
}"
.
format
(
device
)
)
self
.
binary_output
=
binary_output
self
.
_args_parser
=
args_parser
or
DefaultArgumentHandler
()
...
...
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