From e8c3bc331a54807ecb44cbf6c998330e4d96ee8f Mon Sep 17 00:00:00 2001 From: huchukato Date: Fri, 27 Feb 2026 10:12:42 +0100 Subject: [PATCH] Fix TQDMProgressMonitor interface - properly implement IProgressMonitor for both real and dummy TensorRT --- trt_utilities.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/trt_utilities.py b/trt_utilities.py index 8d180ca..a6485d5 100644 --- a/trt_utilities.py +++ b/trt_utilities.py @@ -84,6 +84,23 @@ def is_trt_available(): global _trt_available return _trt_available +class TQDMProgressMonitor: + """Progress monitor that works with both real and dummy TensorRT""" + def __init__(self): + trt = get_trt() + # Initialize attributes regardless of TensorRT availability + self._active_phases = {} + self._step_result = True + self.max_indent = 5 + + # Only inherit from real TensorRT IProgressMonitor if available + if is_trt_available(): + try: + trt.IProgressMonitor.__init__(self) + except Exception as e: + print(f"Warning: Could not initialize IProgressMonitor: {e}") + # If dummy, don't try to inherit - just work with our methods + def diagnose_cuda_environment(): """Diagnose CUDA environment and provide helpful error messages""" print("🔍 Diagnosing CUDA environment...")