diff --git a/modules/chat.py b/modules/chat.py index 694c137b..60ded0b0 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -30,9 +30,13 @@ from modules.text_generation import ( ) from modules.utils import delete_file, get_available_characters, save_file -# Copied from the Transformers library +def strftime_now(format): + return datetime.now().strftime(format) + jinja_env = ImmutableSandboxedEnvironment(trim_blocks=True, lstrip_blocks=True) +jinja_env.globals["strftime_now"] = strftime_now + def str_presenter(dumper, data): """