Skip to content

Commit 873f4d3

Browse files
committed
Fix bug when get shape attribute for PySafeSlice in Windows
1 parent 3e9d351 commit 873f4d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddlenlp/transformers/model_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,12 @@ def _load_part_state_dict(
428428
part_state_dict.update(quant_state_dict)
429429
else:
430430
if key in tensor_parallel_split_mapping:
431-
if len(py_safe_slice_.shape) == 0:
431+
if len(py_safe_slice_.get_shape()) == 0:
432432
weight = tensor_parallel_split_mapping[key](py_safe_slice_.get())
433433
else:
434434
weight = tensor_parallel_split_mapping[key](py_safe_slice_)
435435
else:
436-
if len(py_safe_slice_.shape) == 0:
436+
if len(py_safe_slice_.get_shape()) == 0:
437437
weight = py_safe_slice_.get()
438438
else:
439439
weight = py_safe_slice_[:]

0 commit comments

Comments
 (0)