From ec14d9b725b9008bb9e0079cca7d3fdc227fef00 Mon Sep 17 00:00:00 2001 From: Alexander Dibrov <108030031+dibrale@users.noreply.github.com> Date: Wed, 10 May 2023 09:29:59 -0500 Subject: [PATCH] Fix `custom_generate_chat_prompt` (#1965) --- modules/extensions.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/extensions.py b/modules/extensions.py index 4762901..62a21df 100644 --- a/modules/extensions.py +++ b/modules/extensions.py @@ -75,10 +75,9 @@ def _apply_input_hijack(text, visible_text): # custom_generate_chat_prompt handling - currently only the first one will work def _apply_custom_generate_chat_prompt(text, state, **kwargs): - custom_generate_chat_prompt = None for extension, _ in iterator(): if hasattr(extension, 'custom_generate_chat_prompt'): - return custom_generate_chat_prompt(text, state, **kwargs) + return extension.custom_generate_chat_prompt(text, state, **kwargs) return None