dgs.models.module.enable_keyboard_interrupt

dgs.models.module.enable_keyboard_interrupt(func: callable) callable[source]

Call BaseModule.terminate() on Keyboard Interruption (e.g., ctrl+c), which should make sure that all threads are stopped and the GPU memory is freed.

Parameters:

func – The decorated function

Returns:

Decorated function, which will have advanced keyboard interruption.