[Fix] Weight loading for GPTBigCode (#313)

This commit is contained in:
Zhuohan Li
2023-06-29 22:14:17 -07:00
committed by GitHub
parent 85de093472
commit 598dc4b79a
2 changed files with 18 additions and 4 deletions
+3 -1
View File
@@ -98,7 +98,9 @@ def load_tensor_parallel_weights(
shard_size * tensor_model_parallel_rank
:shard_size * (tensor_model_parallel_rank + 1)]
break
assert param.shape == loaded_weight.shape
assert param.shape == loaded_weight.shape, (
f"{param_name} shape mismatch between model and checkpoint: "
f"{param.shape} != {loaded_weight.shape}")
param.data.copy_(loaded_weight)