diff --git a/captum/attr/_utils/interpretable_input.py b/captum/attr/_utils/interpretable_input.py index 3d5f0566f..5ee947976 100644 --- a/captum/attr/_utils/interpretable_input.py +++ b/captum/attr/_utils/interpretable_input.py @@ -286,6 +286,8 @@ def __init__( self.n_features = n_features self.n_itp_features = n_itp_features + # preserve template before modification + self.template = template if isinstance(template, str): template = template.format else: