Update model_patcher.py

This commit is contained in:
Chenlei Hu 2025-01-06 19:08:16 -05:00 committed by GitHub
parent d24e99bcbe
commit a605201278
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -413,9 +413,9 @@ class ModelPatcher:
The value of the requested attribute
Example:
model = MyModel()
weight = get_attr(model, "layer1.conv.weight")
# Equivalent to: model.layer1.conv.weight
patcher = ModelPatcher()
weight = patcher.get_model_object("layer1.conv.weight")
# Equivalent to: patcher.model.layer1.conv.weight
"""
if name in self.object_patches:
return self.object_patches[name]