mirror of
https://github.com/AIGC-Audio/AudioGPT.git
synced 2025-12-16 11:57:58 +01:00
13 lines
366 B
Python
13 lines
366 B
Python
import sys
|
|
|
|
class ExceptionHook:
|
|
instance = None
|
|
def __call__(self, *args, **kwargs):
|
|
if self.instance is None:
|
|
from IPython.core import ultratb
|
|
self.instance = ultratb.FormattedTB(mode='Plain',
|
|
color_scheme='Linux', call_pdb=1)
|
|
return self.instance(*args, **kwargs)
|
|
|
|
sys.excepthook = ExceptionHook()
|