Files
ModelHub XC 2c9b1de755 初始化项目,由ModelHub XC社区提供模型
Model: lifelinezwz/ft-ielts-speaking-assistant
Source: Original Platform
2026-07-13 08:58:08 +08:00

120 lines
2.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Ielts-speaking-assistant
## 简介
基于YouTube、b站等相关雅思口语模拟考试以及真实测试视频 通过InternLM2微调得到的雅思口语测试助手。雅思口语测试助手旨在帮助模拟雅思口语测试与课程学习。
本项目将介绍关于数据获取、清洗、处理使用InternLM2 微调、LMDeploy量化与推理最后部署至 OpenXLab。
## openxlab模型
模型链接[ielts-speaking-assistant model](https://openxlab.org.cn/models/detail/LocknLock/ft-ietls-speaking-assistant/tree/main)
应用链接 [ielts-speaking-assistant](https://openxlab.org.cn/apps/detail/lumine/ielts-speaking-assistant)
## 数据集
从YouTubeb站爬取了200多个雅思口语对话模拟或者真实视频从中提取对应音频通过音频提取获得对话的原始文档整理对话数据为 XTuner 多轮对话数据格式,如下:
```json
[{
"conversation":[
{
"system": "xxx",
"input": "xxx",
"output": "xxx"
},
{
"input": "xxx",
"output": "xxx"
}
]
},
{
"conversation":[
{
"system": "xxx",
"input": "xxx",
"output": "xxx"
},
{
"input": "xxx",
"output": "xxx"
}
]
}]
```
进一步清洗数据获得最终的多轮对话数据集,用于后续指令微调。
## 微调
基座模型InternLM2-chat-7b
考虑到雅思口语测试过程中存在不同需求:
1. 模拟考官对使用者进行引导与提问
2. 帮助使用者进行提示与回答建议
分别针对不同的目标需求修改指令对话数据集,使用 XTuner 进行微调。
xtuner 安装:
```shell
git clone https://github.com/InternLM/xtuner.git
cd xtuner
pip install -e '.[all]'
```
### SFT训练
整理好数据后,即可进行微调。具体微调的 config 已经放置在 `train/config` 目录下,在安装好 xtuner 后可以进行训练:
```shell
xtuner train ${CONFIG_NAME_OR_PATH} --deepspeed deepspeed_zero2
```
### 模型转换
将得到的 PTH 模型转换为 HuggingFace 模型,生成 Adapter 文件夹
```shell
mkdir hf
export MKL_SERVICE_FORCE_INTEL=1
export MKL_THREADING_LAYER=GNU
xtuner convert pth_to_hf ${CONFIG_NAME_OR_PATH} ${PTH_file_dir} ${SAVE_PATH}
```
### 模型合并
将 HuggingFace adapter 合并到大语言模型:
```shell
xtuner convert merge \
${NAME_OR_PATH_TO_LLM} \
${NAME_OR_PATH_TO_ADAPTER} \
${SAVE_PATH} \
--max-shard-size 2GB
```
可以通过运行接口文件或者通过 xtuner chat 进行模型对话:
```shell
# 运行文件
python ./cli_demo.py
# 加载 Adapter 模型对话Float 16
xtuner chat ${NAME_OR_PATH_TO_ADAPTER} --prompt-template internlm2_chat
```
## 部署
## 量化
## OpenCompass 评测
## 鸣谢
## 特别感谢