This commit is contained in:
Patrick von Platen 2021-04-23 15:36:27 +02:00 committed by GitHub
parent bf2e0cf70b
commit 50f4539b82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,8 @@ def set_recursively(hf_pointer, key, value, full_name, weight_type):
assert (
hf_shape == value.shape
), f"Shape of hf {key + '.' + weight_type} is {hf_shape}, but should be {value.shape} for {full_name}"
), f"Shape of hf {key + '.' + weight_type if weight_type is not None else ''} is {hf_shape}, but should be {value.shape} for {full_name}"
if weight_type == "weight":
hf_pointer.weight.data = value
elif weight_type == "weight_g":