Skip to content

Commit f40b6ed

Browse files
authored
Update hub_mixin.py (#909)
Fix the error caused by pop operation on non-existing key in dict.
1 parent c68fc94 commit f40b6ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

segmentation_models_pytorch/base/hub_mixin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def save_pretrained(
120120
finally:
121121
# delete the additional attributes
122122
self._del_attrs(["save_directory", "metrics", "dataset"])
123-
self._hub_mixin_config.pop("_model_class")
123+
self._hub_mixin_config.pop("_model_class", None)
124124

125125
return result
126126

0 commit comments

Comments
 (0)