Skip to content

Commit 0edb5c4

Browse files
committed
Handle missing torch_dtype in config
1 parent 4751164 commit 0edb5c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

optimum/intel/ipex/modeling_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(
6767
OptimizedModel.__init__(self, model=model, config=config)
6868
# To do: add XPU support
6969
self._device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
70-
self._dtype = self.config.torch_dtype
70+
self._dtype = self.config.torch_dtype if self.config.torch_dtype is not None else torch.float32
7171
self.model.to(self._device)
7272
self.model_save_dir = model_save_dir
7373

0 commit comments

Comments
 (0)