Fix custom_generate_chat_prompt (#1965)

This commit is contained in:
Alexander Dibrov 2023-05-10 09:29:59 -05:00 committed by GitHub
parent 32481ec4d6
commit ec14d9b725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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