[Misc]Suppress irrelevant exception stack trace information when CUDA… (#11438)

Co-authored-by: shiquan <shiquan>
This commit is contained in:
dpxa
2024-12-24 16:43:39 +08:00
committed by GitHub
parent a491d6f535
commit 4f074fbf53

View File

@@ -233,7 +233,8 @@ class LLM:
self.request_counter = Counter()
def __del__(self):
if self.llm_engine and hasattr(self.llm_engine, "shutdown"):
if hasattr(self, 'llm_engine') and self.llm_engine and hasattr(
self.llm_engine, "shutdown"):
self.llm_engine.shutdown()
@staticmethod