Updating the shared settings object when loading a model (#4425)

This commit is contained in:
Mehran Ziadloo 2023-10-31 21:29:57 -07:00 committed by GitHub
parent 9bd0724d85
commit aaf726dbfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -212,6 +212,9 @@ def load_model_wrapper(selected_model, loader, autoload=False):
if 'instruction_template' in settings: if 'instruction_template' in settings:
output += '\n\nIt seems to be an instruction-following model with template "{}". In the chat tab, instruct or chat-instruct modes should be used.'.format(settings['instruction_template']) output += '\n\nIt seems to be an instruction-following model with template "{}". In the chat tab, instruct or chat-instruct modes should be used.'.format(settings['instruction_template'])
# Applying the changes to the global shared settings (in-memory)
shared.settings.update({k: v for k, v in settings.items() if k in shared.settings})
yield output yield output
else: else:
yield f"Failed to load `{selected_model}`." yield f"Failed to load `{selected_model}`."