agent-sft-example
收藏魔搭社区2026-04-29 更新2026-05-03 收录
下载链接:
https://modelscope.cn/datasets/LocoreMind/agent-sft-example
下载链接
链接失效反馈官方服务:
资源简介:
# Agent SFT Example Dataset (CoPaw Format)
This is an example dataset for training agent models with tool calling capabilities using MS-SWIFT, formatted for CoPaw-Flash-9B compatibility.
## Format
The dataset uses the standard **messages format** with only three roles: `system`, `user`, `assistant`.
- **tool_call**: Placed in `assistant` content using XML tags with **snake_case** tool names
- **tool_response**: Placed in `user` content using `<tool_response></tool_response>` tags
## Tool Call Format (CoPaw-Flash-9B Compatible)
```xml
<tool_call>
<function=bash>
<parameter=command>
ls -la
</parameter>
</function>
</tool_call>
```
**Important**: Tool names use **snake_case** format (e.g., `bash`, `read`, `write`, `file_tree`) to match CoPaw-Flash-9B's chat_template.jinja.
## Example Structure
### Single Tool Call
```
system: System prompt with tool definitions
user: User question
assistant: [optional explanation] + <tool_call><function=bash>...</function></tool_call>
user: <tool_response>tool output</tool_response>
assistant: Final answer
```
### Multi-turn Tool Calls
```
system: System prompt
user: User question
assistant: Explanation + <tool_call><function=bash>...</function></tool_call>
user: <tool_response>first result</tool_response>
assistant: Explanation + <tool_call><function=read>...</function></tool_call>
user: <tool_response>second result</tool_response>
assistant: Final summary
```
### Regular Conversation (no tools)
```
user: Regular question
assistant: Direct answer
```
## Available Tools (snake_case)
| Tool Name | Description |
|-----------|-------------|
| `bash` | Execute shell commands |
| `read` | Read file contents |
| `write` | Write content to file |
| `edit` | Edit file contents |
| `glob` | Find files matching pattern |
| `grep` | Search for patterns in files |
| `file_tree` | View directory structure |
| `file_list` | List files in directory |
## Usage with MS-SWIFT
```bash
swift sft \
--model Qwen/Qwen3-4B-Instruct \
--dataset LocoreMind/agent-sft-example \
--tuner_type lora \
--output_dir output
```
## Compatible Models
This format is compatible with:
- CoPaw-Flash-9B
- CoPaw-Flash-9B-Agent-Merged
- Qwen3 series (with appropriate chat template)
- Other models using CoPaw-style XML tool format
## Related Datasets
- [LocoreMind/agent-trajectories-msswift](https://huggingface.co/datasets/LocoreMind/agent-trajectories-msswift) - Full training dataset
# Agent SFT示例数据集(CoPaw格式)
本数据集为适配CoPaw-Flash-9B模型的示例数据集,用于借助MS-SWIFT框架训练具备工具调用能力的智能体模型。
## 数据集格式
该数据集采用标准**消息格式**,仅包含三种角色:`system`(系统)、`user`(用户)、`assistant`(助手)。
- **工具调用(tool_call)**:以XML标签形式置于`assistant`角色的内容中,工具名称采用**蛇形命名法(snake_case)**
- **工具响应(tool_response)**:以`<tool_response></tool_response>`标签形式置于`user`角色的内容中
## 工具调用格式(适配CoPaw-Flash-9B)
xml
<tool_call>
<function=bash>
<parameter=command>
ls -la
</parameter>
</function>
</tool_call>
**重要提示**:工具名称必须采用蛇形命名法(snake_case)(例如`bash`、`read`、`write`、`file_tree`),以匹配CoPaw-Flash-9B的`chat_template.jinja`模板。
## 示例结构
### 单次工具调用
system: 包含工具定义的系统提示词
user: 用户提问
assistant: [可选说明文字] + <tool_call><function=bash>...</function></tool_call>
user: <tool_response>工具输出结果</tool_response>
assistant: 最终回答
### 多轮工具调用
system: 系统提示词
user: 用户提问
assistant: 说明文字 + <tool_call><function=bash>...</function></tool_call>
user: <tool_response>首次执行结果</tool_response>
assistant: 说明文字 + <tool_call><function=read>...</function></tool_call>
user: <tool_response>第二次执行结果</tool_response>
assistant: 最终总结
### 无工具常规对话
user: 常规问题
assistant: 直接回复答案
## 可用工具(蛇形命名法)
| 工具名称 | 功能描述 |
|-----------|-------------|
| `bash` | 执行Shell命令 |
| `read` | 读取文件内容 |
| `write` | 向文件写入内容 |
| `edit` | 编辑文件内容 |
| `glob` | 查找匹配指定模式的文件 |
| `grep` | 在文件中搜索指定模式 |
| `file_tree` | 查看目录结构 |
| `file_list` | 列出目录内的文件 |
## 配合MS-SWIFT的使用方法
bash
swift sft
--model Qwen/Qwen3-4B-Instruct
--dataset LocoreMind/agent-sft-example
--tuner_type lora
--output_dir output
## 兼容模型
本格式兼容以下模型:
- CoPaw-Flash-9B
- CoPaw-Flash-9B-Agent-Merged
- Qwen3系列(需搭配适配的聊天模板)
- 其他采用CoPaw风格XML工具调用格式的模型
## 相关数据集
- [LocoreMind/agent-trajectories-msswift](https://huggingface.co/datasets/LocoreMind/agent-trajectories-msswift) - 完整训练数据集
提供机构:
maas
创建时间:
2026-04-07



