From dd958b4000de8e96909d41aa23d2d4c13b68e918 Mon Sep 17 00:00:00 2001 From: huchukato Date: Fri, 27 Feb 2026 09:58:41 +0100 Subject: [PATCH] Fix TQDMProgressMonitor logic - use is_trt_available() instead of hasattr check --- trt_utilities.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trt_utilities.py b/trt_utilities.py index daf9b16..ed7861b 100644 --- a/trt_utilities.py +++ b/trt_utilities.py @@ -259,9 +259,10 @@ def safe_cuda_call_with_graph_fallback(func, *args, **kwargs): class TQDMProgressMonitor: def __init__(self): trt = get_trt() - # Only call parent __init__ if it's not the dummy class - if hasattr(trt.IProgressMonitor, '__init__') and trt.IProgressMonitor.__init__ is not DummyIProgressMonitor.__init__: + # Only call parent __init__ if TensorRT is actually available (not dummy) + if is_trt_available(): trt.IProgressMonitor.__init__(self) + # If dummy, don't call parent __init__ - just initialize our attributes self._active_phases = {} self._step_result = True self.max_indent = 5