Skip to content

Commit 7b22e83

Browse files
authored
Fix QLoRA example test (#553)
## What does this PR do? **Type of change:** Bug fix <!-- Use one of the following: Bug fix, new feature, new example, new tests, documentation. --> **Overview:** model.active_adapter() call is deprecated, causing the example tests to fail. Updated to use the latest call. ## Usage <!-- You can potentially add a usage example below. --> ```python # Add a code snippet demonstrating how to use this ``` ## Testing <!-- Mention how have you tested your change if applicable. --> ## Before your PR is "*Ready for review*" <!-- If you haven't finished some of the above items you can still open `Draft` PR. --> - **Make sure you read and follow [Contributor guidelines](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CONTRIBUTING.md)** and your commits are signed. - **Is this change backward compatible?**: Yes/No <!--- If No, explain why. --> - **Did you write any new necessary tests?**: Yes/No - **Did you add or update any necessary documentation?**: Yes/No - **Did you update [Changelog](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CHANGELOG.rst)?**: Yes/No <!--- Only for new features, API changes, critical bug fixes or bw breaking changes. --> ## Additional Information <!-- E.g. related issue. --> Signed-off-by: Suguna Velury <[email protected]>
1 parent d311eda commit 7b22e83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modelopt/torch/quantization/plugins/transformers_trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def _load_best_model(self, *args, **kwargs):
302302
if "base_layer" in name
303303
), "Some base_layer parameters are not frozen"
304304

305-
adapter_name = self.model.active_adapter()
305+
adapter_name = self.model.active_adapters()[0]
306306
self.model.delete_adapter(adapter_name)
307307
self.model.load_adapter(self.state.best_model_checkpoint, adapter_name)
308308
else:

0 commit comments

Comments
 (0)