"""Optional stack diagnostics for the isolated inference interpreters.""" import os if os.environ.get('SUPRATEX_TRACE_CHILDREN') == '1': import faulthandler import sys import resource resource.setrlimit(resource.RLIMIT_CORE, (0, 0)) faulthandler.enable() faulthandler.dump_traceback_later(90, repeat=True) print(f'[inference-diagnostics] pid={os.getpid()} entry={sys.argv[0]}: stack snapshots every 90s', file=sys.stderr, flush=True) from hf_space.weight_cache import install install()