Skip to content

Commit 32232bb

Browse files
committed
fix conflict
1 parent de581ea commit 32232bb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

optimum/intel/ipex/modeling_base.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,6 @@ def model_dtype(self):
272272
)
273273
return self._dtype
274274

275-
def _call_model(self, *args, **kwargs):
276-
try:
277-
with torch.autocast(self.device.type, self.dtype), torch.no_grad():
278-
out = self.model(*args, **kwargs)
279-
except RuntimeError:
280-
out = self.model(*args, **kwargs)
281-
return out
282-
283275
def to(self, device: Union[torch.device, str]):
284276
self._device = device if isinstance(device, torch.device) else torch.device(device)
285277
self.model.to(self._device)
@@ -288,6 +280,14 @@ def to(self, device: Union[torch.device, str]):
288280
def can_generate(self):
289281
return isinstance(self, GenerationMixin)
290282

283+
def _call_model(self, *args, **kwargs):
284+
try:
285+
with torch.autocast(self.device.type, self.dtype), torch.no_grad():
286+
out = self.model(*args, **kwargs)
287+
except RuntimeError:
288+
out = self.model(*args, **kwargs)
289+
return out
290+
291291
def _init_warmup(self):
292292
# warmup, the first 2 forwards of an IPEX model include some preprocessing steps and
293293
# the results of the compute are unpredictable

0 commit comments

Comments
 (0)