mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-14 20:58:08 +00:00
parent
b912f5ee43
commit
bcb841f007
1 changed files with 3 additions and 0 deletions
|
|
@ -1148,6 +1148,9 @@ class Pipeline(_ScikitCompat, PushToHubMixin):
|
|||
elif self.device.type == "musa":
|
||||
with torch.musa.device(self.device):
|
||||
yield
|
||||
elif self.device.type == "xpu":
|
||||
with torch.xpu.device(self.device):
|
||||
yield
|
||||
else:
|
||||
yield
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue