Update README.md
Browse files
README.md
CHANGED
|
@@ -1,33 +1,94 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
-
|
| 5 |
-
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
##
|
| 25 |
|
| 26 |
```python
|
| 27 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 28 |
|
| 29 |
-
#
|
| 30 |
-
model_name = "
|
| 31 |
model = AutoModelForCausalLM.from_pretrained(
|
| 32 |
model_name,
|
| 33 |
torch_dtype="auto",
|
|
@@ -35,14 +96,14 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 35 |
)
|
| 36 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 37 |
|
| 38 |
-
# 准备输入
|
| 39 |
-
prompt = "Give me a short introduction to large language model."
|
| 40 |
messages = [
|
| 41 |
{"role": "system", "content": "你是北京师范大学和好未来开发的人工智能语言模型,名为师承万象。可以回答问题、提供信息、进行对话并帮助解决问题。"},
|
| 42 |
{"role": "user", "content": prompt}
|
| 43 |
]
|
| 44 |
|
| 45 |
-
# 生成回复
|
| 46 |
text = tokenizer.apply_chat_template(
|
| 47 |
messages,
|
| 48 |
tokenize=False,
|
|
@@ -61,36 +122,19 @@ generated_ids = [
|
|
| 61 |
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 62 |
```
|
| 63 |
|
|
|
|
| 64 |
|
|
|
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
```
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
- 答疑过程中,应确保最终引导我得出正确答案,而不是在中途终止推理。
|
| 78 |
-
- 答疑过程中对我的提问要明确回答,要提醒用户回归对话主题
|
| 79 |
-
- 在通过一步步推理得到答案之前,不能结束对话。
|
| 80 |
-
答疑结束条件:
|
| 81 |
-
- 你在得出完整的正确答案的回复中消息:
|
| 82 |
-
* 避免突然结束,确保有完整的认知闭环
|
| 83 |
-
* 明确说出正确答案(如"正确答案为...""本题答案为..."等)"""
|
| 84 |
-
```
|
| 85 |
-
|
| 86 |
-
### 4.4.2 智能答疑
|
| 87 |
-
|
| 88 |
-
```python
|
| 89 |
-
system_prompt = """"""
|
| 90 |
-
```
|
| 91 |
-
|
| 92 |
-
### 4.4.3 教案生成
|
| 93 |
-
|
| 94 |
-
```python
|
| 95 |
-
system_prompt = """"""
|
| 96 |
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- zh
|
| 6 |
+
base_model:
|
| 7 |
+
- Qwen/Qwen2.5-14B-Instruct
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
+
tags:
|
| 10 |
+
- Education
|
| 11 |
+
- K12
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
<div align="center">
|
| 15 |
+
|
| 16 |
+
<h1 style="font-size: 2.8em; margin-bottom: 0.5em;">师承万象教育大模型(MuduoLLM)</h1>
|
| 17 |
+
<h2 style="font-size: 1.8em; color: #666; margin-top: 0;">传承木铎金声,智启教育未来<br>Inheriting Wisdom, Inspiring Future Education</h2>
|
| 18 |
+
|
| 19 |
+
[](https://opensource.org/licenses/Apache-2.0)
|
| 20 |
+
[]()
|
| 21 |
+
[]()
|
| 22 |
+
[]()
|
| 23 |
+
[](https://github.com/ERC-ITEA/MuduoLLM)
|
| 24 |
+
|
| 25 |
+
</div>
|
| 26 |
+
|
| 27 |
+
# 简介 | Introduction
|
| 28 |
+
|
| 29 |
+
师承万象大模型(MuduoLLM)是北京师范大学和北京世纪好未来教育科技有限公司共同研发的首个紧扣新课标知识体系的基础教育大模型,确保所学知识内容与基础教育课程标准高度契合,精准对接学生核心素养培育与教师专业成长需求。在应用层面,基础教育大模型深度融合新课标理念,实现探究启发式智能答疑、素养导向型智能出题、情境沉浸式教案生成,从知识传授转向核心素养培育,助力培养全面发展时代新人。同时,师承万象大模型是当前性能表现较为突出的开源基础教育大模型之一,为开发者提供了可进一步优化的空间。
|
| 30 |
+
|
| 31 |
+
MuduoLLM is the educational large language model jointly developed by Beijing Normal University and TAL Education Group, tightly integrated with the new curriculum standards knowledge system. It ensures that the knowledge content aligns perfectly with basic education curriculum standards, precisely meeting the needs of student core competency cultivation and teacher professional development. At the application level, the model deeply integrates new curriculum concepts, enabling inquiry-based intelligent Q&A, competency-oriented question generation, and immersive lesson plan creation, shifting from knowledge transmission to core competency cultivation, helping to nurture well-rounded individuals for the new era. Additionally, MuduoLLM is one of the most outstanding open-source educational large language models, providing developers with room for further optimization.
|
| 32 |
+
|
| 33 |
+
## 模型概述 | Model Overview
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
- **Base Architecture**: [Qwen2.5-14B-Instruct](https://huggingface.co/Qwen/Qwen2.5-14B-Instruct)
|
| 37 |
+
- **Parameters**: 14 billion (14B)
|
| 38 |
+
- **Training Data**: Approximately 400GB of educational domain text data, including question generation, Q&A, and lesson plans
|
| 39 |
+
- **Training Methods**:
|
| 40 |
+
- Domain-specific Pretraining: Injecting educational domain-specific corpora to enhance semantic understanding
|
| 41 |
+
- Supervised Fine-Tuning (SFT): Targeted optimization for educational scenarios (question generation/Q&A/lesson plan generation)
|
| 42 |
+
- Direct Preference Optimization (DPO): Improving generation accuracy and educational ethics compliance through expert-annotated preference data
|
| 43 |
+
|
| 44 |
+
## 训练环境 | Training Environment
|
| 45 |
+
|
| 46 |
+
- **Hardware Configuration**:
|
| 47 |
+
- Number of Servers: 4
|
| 48 |
+
- GPU Configuration: 8 NVIDIA A800-SXM4-80GB per server (32 total)
|
| 49 |
+
- Single GPU Memory: 80GB
|
| 50 |
+
- Interconnection: NVLink 4.0 (9.6TB/s bandwidth)
|
| 51 |
+
- Parallel Strategy: Data Parallel + Tensor Parallel
|
| 52 |
+
- **Software**:
|
| 53 |
+
- Base Framework:
|
| 54 |
+
- CUDA: 12.4
|
| 55 |
+
- PyTorch: 2.5.1+cu124
|
| 56 |
+
- Optimization Tools:
|
| 57 |
+
- DeepSpeed: 0.15.4 (ZeRO-3 optimizer)
|
| 58 |
+
- FlashAttention
|
| 59 |
+
- Training Precision: bfloat16 mixed precision
|
| 60 |
+
- Runtime Environment: Conda virtual environment + Weights & Biases monitoring
|
| 61 |
+
- **Training Duration**: 10 days
|
| 62 |
+
|
| 63 |
+
# 快速开始 | Quick Start
|
| 64 |
+
|
| 65 |
+
## 环境要求 | Requirements
|
| 66 |
+
|
| 67 |
+
- Python 3.10
|
| 68 |
+
- PyTorch
|
| 69 |
+
- transformers >= 4.37.0
|
| 70 |
+
|
| 71 |
+
## 安装 | Installation
|
| 72 |
+
|
| 73 |
+
```bash
|
| 74 |
+
# 克隆仓库 | Clone repository
|
| 75 |
+
huggingface-cli download --resume-download ERC-ITEA/MuduoLLM --local-dir ./muduo-llm/
|
| 76 |
+
|
| 77 |
+
# 创建环境 | Create environment
|
| 78 |
+
conda create --name muduo python=3.10
|
| 79 |
+
conda activate muduo
|
| 80 |
+
|
| 81 |
+
# 安装依赖 | Install dependencies
|
| 82 |
+
pip install transformers
|
| 83 |
+
```
|
| 84 |
|
| 85 |
+
## 使用示例 | Usage Example
|
| 86 |
|
| 87 |
```python
|
| 88 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 89 |
|
| 90 |
+
# 加载模型和分词器 | Load model and tokenizer
|
| 91 |
+
model_name = "MuduoLLM"
|
| 92 |
model = AutoModelForCausalLM.from_pretrained(
|
| 93 |
model_name,
|
| 94 |
torch_dtype="auto",
|
|
|
|
| 96 |
)
|
| 97 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 98 |
|
| 99 |
+
# 准备输入 | Prepare input
|
| 100 |
+
prompt = "Give me a short introduction to large language model."
|
| 101 |
messages = [
|
| 102 |
{"role": "system", "content": "你是北京师范大学和好未来开发的人工智能语言模型,名为师承万象。可以回答问题、提供信息、进行对话并帮助解决问题。"},
|
| 103 |
{"role": "user", "content": prompt}
|
| 104 |
]
|
| 105 |
|
| 106 |
+
# 生成回复 | Generate response
|
| 107 |
text = tokenizer.apply_chat_template(
|
| 108 |
messages,
|
| 109 |
tokenize=False,
|
|
|
|
| 122 |
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 123 |
```
|
| 124 |
|
| 125 |
+
# 许可证 | License
|
| 126 |
|
| 127 |
+
This project is licensed under the [Apache 2.0](https://opensource.org/licenses/Apache-2.0) License.
|
| 128 |
|
| 129 |
+
This project is for research purposes only. The project developers are not responsible for any harm or loss caused by using this project (including but not limited to data, models, code, etc.).
|
| 130 |
|
| 131 |
+
# 引用 | Citation
|
| 132 |
|
| 133 |
+
```bibtex
|
| 134 |
+
@misc{muduollm2025,
|
| 135 |
+
title={MuduoLLM: A High-Performance LLM for Intelligent Education Solutions},
|
| 136 |
+
author={MuduoLLM Contributors from BNU and TAL},
|
| 137 |
+
year={2025},
|
| 138 |
+
howpublished={\url{https://huggingface.co/ERC-ITEA/MuduoLLM}},
|
| 139 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
```
|