When loading c4ai-command-r-v01, I encountered the follow error messages:
AttributeError: 'list' object has no attribute 'replace'
But when loading c4ai-command-r-v01-4bit, there had been no error.
Using Reka Core, it suggested me to make these changes, and it worked.
modules\models_settings.py
def get_model_metadata(model):
model_settings = {}
# ...
if 'chat_template' in metadata:
template = metadata['chat_template']
if isinstance(template, list):
template = template[0]['template'] if len(template) > 0 else ''
elif not isinstance(template, str):
template = ''
# ...
# ...
modules\chat.py
def chatbot_wrapper(text, state, regenerate=regenerate, _continue=_continue, loading_message=loading_message, for_ui=for_ui):
if text is None:
return []
else:
...
Is there an existing issue for this?
[X] I have searched the existing issues
Reproduction
load c4ai-command-r-v01 with --load-in-8bit or --load-in-4bit, the "AttributeError: 'list' object has no attribute 'replace'" occurs.
Screenshot
No response
Logs
Traceback (most recent call last):
File "/mnt/green/text-generation-webui/modules/ui_model_menu.py", line 245, in load_model_wrapper
shared.model, shared.tokenizer = load_model(selected_model, loader)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/green/text-generation-webui/modules/models.py", line 76, in load_model
metadata = get_model_metadata(model_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/green/text-generation-webui/modules/models_settings.py", line 122, in get_model_metadata
template = template.replace(k, "'{}'".format(value))
^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'replace'
This issue has been closed due to inactivity for 2 months. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment.
Describe the bug
When loading c4ai-command-r-v01, I encountered the follow error messages: AttributeError: 'list' object has no attribute 'replace' But when loading c4ai-command-r-v01-4bit, there had been no error.
Using Reka Core, it suggested me to make these changes, and it worked. modules\models_settings.py def get_model_metadata(model): model_settings = {}
modules\chat.py def chatbot_wrapper(text, state, regenerate=regenerate, _continue=_continue, loading_message=loading_message, for_ui=for_ui): if text is None: return [] else: ...
Is there an existing issue for this?
Reproduction
load c4ai-command-r-v01 with --load-in-8bit or --load-in-4bit, the "AttributeError: 'list' object has no attribute 'replace'" occurs.
Screenshot
No response
Logs
System Info