Open anhuong opened 9 months ago
thats a bit of weird since gc / collect should be there.. I wonder if this is coming from next line, i.e torch.cuda.empty_cache
since when we are not running on GPUs, then this line might behave differently and we are only catching AttributeError
and not TypeError
🤔
Describe the bug
When loading a PeftPromptTuned model and then running inference on the model, this works successfully but there is an ignored exception that occurs at the end after running inference. This occurs in the
__del__
function that runs at the end when trying to destroy the object.What I run where the input is a model tuned with caikit-nlp prior and saved to a directory outside of caikit-nlp:
Output:
The line specified is
gc.collect()
herePlatform
Please provide details about the environment you are using, including the following:
50f1023ee24150ed98a48d263cb8fcb9070db10d
Expected behavior
No exception message should be printed. We can expect the error if there is nothing to delete. Add a try-catch for exception: