Fix/issue 3667 vicuna template (#5357)
* Fix: Add missing utf-8 encoding to text-mode file operations Fixes #2795 by explicitly adding encoding='utf-8' to open() calls. This prevents UnicodeDecodeError on Windows with non-UTF-8 system locales when processing files containing UTF-8 characters. * fix(chat_templates): escape apostrophe in vicuna default system message The unescaped apostrophe in 'user's' broke Jinja2 template parsing when _change_system_message() substituted the default message into the template string via re.sub. Escape it with \' to match the existing vicuna_old pattern. Fixes #3667 --------- Co-authored-by: Roland Tannous <115670425+rolandtannous@users.noreply.github.com>
This commit is contained in:
parent
ba833b4ade
commit
739ebeea82
1 changed files with 1 additions and 1 deletions
|
|
@ -211,7 +211,7 @@ vicuna_ollama = _ollama_template("vicuna")
|
|||
|
||||
vicuna_eos_token = "eos_token"
|
||||
CHAT_TEMPLATES["vicuna"] = (vicuna_template, vicuna_eos_token, False, vicuna_ollama,)
|
||||
DEFAULT_SYSTEM_MESSAGE["vicuna"] = "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions."
|
||||
DEFAULT_SYSTEM_MESSAGE["vicuna"] = "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user\\'s questions."
|
||||
|
||||
# =========================================== Vicuna Old
|
||||
# https://github.com/lm-sys/FastChat/blob/main/docs/vicuna_weights_version.md#prompt-template
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue