From 64a76856bdbe72e486324b9b753a111c0c8e4adf Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 6 Apr 2024 07:32:17 -0700 Subject: [PATCH] Metadata: Fix loading Command R+ template with multiple options --- modules/models_settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/models_settings.py b/modules/models_settings.py index 12a2db82..85689b8b 100644 --- a/modules/models_settings.py +++ b/modules/models_settings.py @@ -117,6 +117,9 @@ def get_model_metadata(model): metadata = json.loads(open(path, 'r', encoding='utf-8').read()) if 'chat_template' in metadata: template = metadata['chat_template'] + if isinstance(template, list): + template = template[0]['template'] + for k in ['eos_token', 'bos_token']: if k in metadata: value = metadata[k]