mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-12-26 14:20:40 +01:00
Metadata: Fix loading Command R+ template with multiple options
This commit is contained in:
parent
1b87844928
commit
64a76856bd
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user