We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0395675 commit e39b304Copy full SHA for e39b304
src/transformers/pipelines/base.py
@@ -997,7 +997,7 @@ def __init__(
997
else:
998
self.device = device if device is not None else -1
999
1000
- if torch.distributed.is_initialized():
+ if is_torch_available() and torch.distributed.is_initialized():
1001
self.device = self.model.device
1002
logger.warning(f"Device set to use {self.device}")
1003
0 commit comments