Remove f-string device creation on PyTorch GPU pipelines.

Signed-off-by: Morgan Funtowicz <morgan@huggingface.co>
This commit is contained in:
Morgan Funtowicz 2020-01-07 11:46:44 +01:00
parent 91d33c798b
commit 9261c7f771

View File

@ -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()