mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-02 19:52:50 +08:00
[misc] tiny fixes (#8348)
This commit is contained in:
parent
d39d3106cb
commit
5ed62a29c5
@ -280,7 +280,7 @@ Choose your path:
|
|||||||
| [LLaVA-NeXT](https://huggingface.co/llava-hf) | 7B/8B/13B/34B/72B/110B | llava_next |
|
| [LLaVA-NeXT](https://huggingface.co/llava-hf) | 7B/8B/13B/34B/72B/110B | llava_next |
|
||||||
| [LLaVA-NeXT-Video](https://huggingface.co/llava-hf) | 7B/34B | llava_next_video |
|
| [LLaVA-NeXT-Video](https://huggingface.co/llava-hf) | 7B/34B | llava_next_video |
|
||||||
| [MiMo](https://huggingface.co/XiaomiMiMo) | 7B | mimo |
|
| [MiMo](https://huggingface.co/XiaomiMiMo) | 7B | mimo |
|
||||||
| [MiniCPM](https://huggingface.co/openbmb) | 1B/2B/4B | cpm/cpm3 |
|
| [MiniCPM](https://huggingface.co/openbmb) | 0.5B/1B/2B/4B/8B | cpm/cpm3/cpm4 |
|
||||||
| [MiniCPM-o-2.6/MiniCPM-V-2.6](https://huggingface.co/openbmb) | 8B | minicpm_o/minicpm_v |
|
| [MiniCPM-o-2.6/MiniCPM-V-2.6](https://huggingface.co/openbmb) | 8B | minicpm_o/minicpm_v |
|
||||||
| [Ministral/Mistral-Nemo](https://huggingface.co/mistralai) | 8B/12B | ministral |
|
| [Ministral/Mistral-Nemo](https://huggingface.co/mistralai) | 8B/12B | ministral |
|
||||||
| [Mistral/Mixtral](https://huggingface.co/mistralai) | 7B/8x7B/8x22B | mistral |
|
| [Mistral/Mixtral](https://huggingface.co/mistralai) | 7B/8x7B/8x22B | mistral |
|
||||||
|
@ -282,7 +282,7 @@ https://github.com/user-attachments/assets/43b700c6-a178-41db-b1f8-8190a5d3fcfc
|
|||||||
| [LLaVA-NeXT](https://huggingface.co/llava-hf) | 7B/8B/13B/34B/72B/110B | llava_next |
|
| [LLaVA-NeXT](https://huggingface.co/llava-hf) | 7B/8B/13B/34B/72B/110B | llava_next |
|
||||||
| [LLaVA-NeXT-Video](https://huggingface.co/llava-hf) | 7B/34B | llava_next_video |
|
| [LLaVA-NeXT-Video](https://huggingface.co/llava-hf) | 7B/34B | llava_next_video |
|
||||||
| [MiMo](https://huggingface.co/XiaomiMiMo) | 7B | mimo |
|
| [MiMo](https://huggingface.co/XiaomiMiMo) | 7B | mimo |
|
||||||
| [MiniCPM](https://huggingface.co/openbmb) | 1B/2B/4B | cpm/cpm3 |
|
| [MiniCPM](https://huggingface.co/openbmb) | 0.5B/1B/2B/4B/8B | cpm/cpm3/cpm4 |
|
||||||
| [MiniCPM-o-2.6/MiniCPM-V-2.6](https://huggingface.co/openbmb) | 8B | minicpm_o/minicpm_v |
|
| [MiniCPM-o-2.6/MiniCPM-V-2.6](https://huggingface.co/openbmb) | 8B | minicpm_o/minicpm_v |
|
||||||
| [Ministral/Mistral-Nemo](https://huggingface.co/mistralai) | 8B/12B | ministral |
|
| [Ministral/Mistral-Nemo](https://huggingface.co/mistralai) | 8B/12B | ministral |
|
||||||
| [Mistral/Mixtral](https://huggingface.co/mistralai) | 7B/8x7B/8x22B | mistral |
|
| [Mistral/Mixtral](https://huggingface.co/mistralai) | 7B/8x7B/8x22B | mistral |
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 169 KiB |
Binary file not shown.
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 167 KiB |
@ -501,7 +501,11 @@ def register_template(
|
|||||||
default_slots = ["{{content}}"] if efficient_eos else ["{{content}}", {"eos_token"}]
|
default_slots = ["{{content}}"] if efficient_eos else ["{{content}}", {"eos_token"}]
|
||||||
default_user_formatter = StringFormatter(slots=["{{content}}"])
|
default_user_formatter = StringFormatter(slots=["{{content}}"])
|
||||||
default_assistant_formatter = StringFormatter(slots=default_slots)
|
default_assistant_formatter = StringFormatter(slots=default_slots)
|
||||||
default_function_formatter = FunctionFormatter(slots=default_slots, tool_format="default")
|
if format_assistant is not None:
|
||||||
|
default_function_formatter = FunctionFormatter(slots=format_assistant.slots, tool_format="default")
|
||||||
|
else:
|
||||||
|
default_function_formatter = FunctionFormatter(slots=default_slots, tool_format="default")
|
||||||
|
|
||||||
default_tool_formatter = ToolFormatter(tool_format="default")
|
default_tool_formatter = ToolFormatter(tool_format="default")
|
||||||
default_prefix_formatter = EmptyFormatter()
|
default_prefix_formatter = EmptyFormatter()
|
||||||
TEMPLATES[name] = template_class(
|
TEMPLATES[name] = template_class(
|
||||||
@ -798,6 +802,7 @@ register_template(
|
|||||||
format_user=StringFormatter(slots=["<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]),
|
format_user=StringFormatter(slots=["<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]),
|
||||||
format_assistant=StringFormatter(slots=["{{content}}<|im_end|>\n"]),
|
format_assistant=StringFormatter(slots=["{{content}}<|im_end|>\n"]),
|
||||||
format_system=StringFormatter(slots=["<|im_start|>system\n{{content}}<|im_end|>\n"]),
|
format_system=StringFormatter(slots=["<|im_start|>system\n{{content}}<|im_end|>\n"]),
|
||||||
|
format_observation=StringFormatter(slots=["<|im_start|>tool\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]),
|
||||||
format_prefix=EmptyFormatter(slots=[{"bos_token"}]),
|
format_prefix=EmptyFormatter(slots=[{"bos_token"}]),
|
||||||
stop_words=["<|im_end|>"],
|
stop_words=["<|im_end|>"],
|
||||||
)
|
)
|
||||||
@ -809,37 +814,9 @@ register_template(
|
|||||||
format_user=StringFormatter(slots=["<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]),
|
format_user=StringFormatter(slots=["<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]),
|
||||||
format_assistant=StringFormatter(slots=["{{content}}<|im_end|>\n"]),
|
format_assistant=StringFormatter(slots=["{{content}}<|im_end|>\n"]),
|
||||||
format_system=StringFormatter(slots=["<|im_start|>system\n{{content}}<|im_end|>\n"]),
|
format_system=StringFormatter(slots=["<|im_start|>system\n{{content}}<|im_end|>\n"]),
|
||||||
format_function=FunctionFormatter(slots=["{{content}}<|im_end|>\n"], tool_format="default"),
|
|
||||||
format_observation=StringFormatter(slots=["<|im_start|>tool\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]),
|
format_observation=StringFormatter(slots=["<|im_start|>tool\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]),
|
||||||
format_tools=ToolFormatter(tool_format="default"),
|
|
||||||
format_prefix=EmptyFormatter(slots=[{"bos_token"}]),
|
format_prefix=EmptyFormatter(slots=[{"bos_token"}]),
|
||||||
thought_words=("<|thought_start|>", "<|thought_end|>"),
|
stop_words=["<|im_end|>"],
|
||||||
stop_words=["<|im_end|>", "<|tool_call_start|>", "<|tool_call_end|>"],
|
|
||||||
default_system=(
|
|
||||||
"# Functions\n"
|
|
||||||
"Here is a list of functions that you can invoke:\n"
|
|
||||||
"```python\n"
|
|
||||||
"from enum import Enum\n"
|
|
||||||
"from typing import List, Dict, Optional\n"
|
|
||||||
"from pydantic import BaseModel, Field\n"
|
|
||||||
"```\n\n"
|
|
||||||
"# Function Call Rule and Output Format\n"
|
|
||||||
"- If the user's question can be answered without calling any function, please answer the user's question directly. In this situation, you should return your thought and answer the user's question directly.\n"
|
|
||||||
"- If the user cannot be answered without calling any function, and the user does not provide enough information to call functions, please ask the user for more information. In this situation, you should return your thought and ask the user for more information.\n"
|
|
||||||
"- If the user's question cannot be answered without calling any function, and the user has provided enough information to call functions to solve it, you should call the functions. In this situation, the assistant should return your thought and call the functions.\n"
|
|
||||||
"- Use default parameters unless the user has specified otherwise.\n"
|
|
||||||
"- You should answer in the following format:\n\n"
|
|
||||||
"<|thought_start|>\n"
|
|
||||||
"{explain why the user's question can be answered without calling a function or why you should ask the user for more information or why you should call one or more functions and your plan to solve the user's question.}\n"
|
|
||||||
"<|thought_end|>\n"
|
|
||||||
"<|tool_call_start|>\n"
|
|
||||||
"```python\n"
|
|
||||||
"func1(params_name=params_value, params_name2=params_value2...)\n"
|
|
||||||
"func2(params)\n"
|
|
||||||
"```\n"
|
|
||||||
"<|tool_call_end|>\n"
|
|
||||||
"{answer the user's question directly or ask the user for more information}"
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1502,18 +1502,13 @@ register_model_group(
|
|||||||
template="cpm3",
|
template="cpm3",
|
||||||
)
|
)
|
||||||
|
|
||||||
register_model_group(
|
|
||||||
models={
|
|
||||||
"MiniCPM4-0_5B-Chat": {
|
|
||||||
DownloadSource.DEFAULT: "openbmb/MiniCPM4-0.5B",
|
|
||||||
DownloadSource.MODELSCOPE: "OpenBMB/MiniCPM4-0.5B",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
template="cpm4",
|
|
||||||
)
|
|
||||||
|
|
||||||
register_model_group(
|
register_model_group(
|
||||||
models={
|
models={
|
||||||
|
"MiniCPM4-0.5B-Chat": {
|
||||||
|
DownloadSource.DEFAULT: "openbmb/MiniCPM4-0.5B",
|
||||||
|
DownloadSource.MODELSCOPE: "OpenBMB/MiniCPM4-0.5B",
|
||||||
|
},
|
||||||
"MiniCPM4-8B-Chat": {
|
"MiniCPM4-8B-Chat": {
|
||||||
DownloadSource.DEFAULT: "openbmb/MiniCPM4-8B",
|
DownloadSource.DEFAULT: "openbmb/MiniCPM4-8B",
|
||||||
DownloadSource.MODELSCOPE: "OpenBMB/MiniCPM4-8B",
|
DownloadSource.MODELSCOPE: "OpenBMB/MiniCPM4-8B",
|
||||||
@ -1522,6 +1517,7 @@ register_model_group(
|
|||||||
template="cpm4",
|
template="cpm4",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
register_model_group(
|
register_model_group(
|
||||||
models={
|
models={
|
||||||
"MiniCPM-o-2_6": {
|
"MiniCPM-o-2_6": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user