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
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
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 # custom_generate_chat_prompt handling - currently only the first one will work
def _apply_custom_generate_chat_prompt(text, state, **kwargs): def _apply_custom_generate_chat_prompt(text, state, **kwargs):
custom_generate_chat_prompt = None
for extension, _ in iterator(): for extension, _ in iterator():
if hasattr(extension, 'custom_generate_chat_prompt'): 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 return None