Skip to content

Commit

Permalink
fix vicuna template
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyouga committed Oct 27, 2023
1 parent 4117f38 commit 52fc24d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ https://github.com/hiyouga/LLaMA-Factory/assets/16256802/6ba60acc-e2e2-4bec-b846
> **Default module** is used for the `--lora_target` argument, you can use `--lora_target all` to specify all the available modules.
>
> For the "base" models, the `--template` argument can be chosen from `default`, `alpaca`, `vicuna` etc. But make sure to use the **corresponding template** for the "chat" models.
>
> Please refer to [template.py](src/llmtuner/extras/template.py) for a full list of models we supported.
Please refer to [template.py](src/llmtuner/extras/template.py) for a full list of models we supported.

## Supported Training Approaches

Expand Down
4 changes: 2 additions & 2 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ https://github.com/hiyouga/LLaMA-Factory/assets/16256802/6ba60acc-e2e2-4bec-b846
> **默认模块**应作为 `--lora_target` 参数的默认值,可使用 `--lora_target all` 参数指定全部模块。
>
> 对于所有“基座”(Base)模型,`--template` 参数可以是 `default`, `alpaca`, `vicuna` 等任意值。但“对话”(Chat)模型请务必使用**对应的模板**
>
> 项目所支持模型的完整列表请参阅 [template.py](src/llmtuner/extras/template.py)
项目所支持模型的完整列表请参阅 [template.py](src/llmtuner/extras/template.py)

## 训练方法

Expand Down
5 changes: 3 additions & 2 deletions src/llmtuner/extras/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def get_template_and_fix_tokenizer(
"{{system}}"
],
prompt=[
"USER: {{query}} ASSISTANT: "
"USER: {{query}} ASSISTANT:"
],
system=(
"A chat between a curious user and an artificial intelligence assistant. "
Expand Down Expand Up @@ -366,6 +366,7 @@ def get_template_and_fix_tokenizer(

r"""
Supports: https://huggingface.co/IDEA-CCNL/Ziya-LLaMA-13B-v1
https://huggingface.co/IDEA-CCNL/Ziya-LLaMA-13B-v1.1
https://huggingface.co/IDEA-CCNL/Ziya2-13B-Chat
"""
register_template(
Expand Down Expand Up @@ -397,7 +398,7 @@ def get_template_and_fix_tokenizer(
"{{system}}"
],
prompt=[
"Human: {{query}}###Assistant: "
"Human: {{query}}###Assistant:"
],
system=(
"A chat between a curious human and an artificial intelligence assistant. "
Expand Down

0 comments on commit 52fc24d

Please sign in to comment.