Upload folder using huggingface_hub
Browse files- .gitattributes +2 -0
- README.md +75 -82
- images/OSUM-Pangu.jpg +3 -0
- images/architecture1.png +3 -0
.gitattributes
CHANGED
|
@@ -38,3 +38,5 @@ images/Strategy.png filter=lfs diff=lfs merge=lfs -text
|
|
| 38 |
images/structure.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
images/table1.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
images/table4.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 38 |
images/structure.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
images/table1.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
images/table4.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
images/OSUM-Pangu.jpg filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
images/architecture1.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,48 +1,27 @@
|
|
| 1 |
<p align="center">
|
| 2 |
-
<h1>
|
| 3 |
<p>
|
| 4 |
|
| 5 |
-
Yujie Liao, Xuelong Geng, Shuiyuan Wang, Lei Xie
|
| 6 |
|
| 7 |
<p align="center">
|
| 8 |
-
<img src="images/
|
| 9 |
<p>
|
| 10 |
|
| 11 |
<p align="center">
|
| 12 |
-
<a href="https://github.com/ASLP-lab/
|
| 13 |
</p>
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
We propose **I-OSUM-Pangu**, an efficient, controllable, and fully open-source speech understanding framework.
|
| 18 |
-
|
| 19 |
-
The model is built upon:
|
| 20 |
-
|
| 21 |
-
- Whisper-medium speech encoder (from the Whisper series developed by :contentReference[oaicite:0]{index=0})
|
| 22 |
-
- :contentReference[oaicite:1]{index=1} 7B large language model backbone
|
| 23 |
-
|
| 24 |
-
The core objective of our framework is to enable the model to:
|
| 25 |
-
|
| 26 |
-
- Understand user instructions expressed in natural language
|
| 27 |
-
- Automatically identify user intent
|
| 28 |
-
- Route the request to the corresponding speech understanding task
|
| 29 |
-
- Work without relying on fixed prompt templates
|
| 30 |
-
|
| 31 |
-
Experimental results show that:
|
| 32 |
-
|
| 33 |
-
- The Instruction Following Rate (IFR) exceeds **90%**
|
| 34 |
-
- While maintaining comparable task performance with traditional fixed-tag approaches
|
| 35 |
-
|
| 36 |
-
This project releases both code and model weights, aiming to provide a **reproducible and extensible open-source framework** for speech understanding research.
|
| 37 |
|
| 38 |
---
|
| 39 |
|
| 40 |
## Architecture
|
| 41 |
|
| 42 |
-
The overall architecture of
|
| 43 |
|
| 44 |
<p align="center">
|
| 45 |
-
<img src="images/
|
| 46 |
<p>
|
| 47 |
|
| 48 |
The model mainly consists of three components:
|
|
@@ -55,7 +34,11 @@ Responsible for extracting speech representations.
|
|
| 55 |
Transforms acoustic features into tokens compatible with the LLM input space.
|
| 56 |
|
| 57 |
### 3. Intent-aware LLM
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
Responsible for:
|
| 61 |
- Parsing natural language instructions
|
|
@@ -66,7 +49,7 @@ Responsible for:
|
|
| 66 |
|
| 67 |
## Training Strategy
|
| 68 |
|
| 69 |
-
We
|
| 70 |
|
| 71 |
<p align="center">
|
| 72 |
<img src="images/Strategy.png" width="80%"/>
|
|
@@ -118,15 +101,37 @@ The model can correctly understand and execute all of them.
|
|
| 118 |
|
| 119 |
---
|
| 120 |
|
| 121 |
-
##
|
| 122 |
|
| 123 |
### Dataset Configuration
|
| 124 |
|
| 125 |
-
|
| 126 |
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
---
|
| 132 |
|
|
@@ -144,12 +149,13 @@ where:
|
|
| 144 |
|
| 145 |
- $N_{correct}$ represents the number of correctly executed instructions
|
| 146 |
- $N_{total}$ represents the total number of evaluation samples
|
|
|
|
| 147 |
|
| 148 |
-
Compared with mainstream open-source models, **I-OSUM-Pangu achieves significantly better performance**:
|
| 149 |
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
|
|
|
| 153 |
|
| 154 |
---
|
| 155 |
|
|
@@ -159,9 +165,18 @@ We evaluate whether natural language instructions (NL) degrade performance compa
|
|
| 159 |
|
| 160 |
Results show that the model maintains strong flexibility while preserving task accuracy.
|
| 161 |
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
Conclusion:
|
| 167 |
|
|
@@ -176,50 +191,29 @@ Core tasks such as:
|
|
| 176 |
- SER
|
| 177 |
- SAP
|
| 178 |
|
| 179 |
-
remain almost unchanged, validating the effectiveness of the
|
| 180 |
|
| 181 |
---
|
| 182 |
|
| 183 |
-
### Multi-task Speech Understanding Performance
|
| 184 |
-
|
| 185 |
-
On public benchmarks, the model demonstrates competitive performance across multiple tasks, particularly in:
|
| 186 |
-
|
| 187 |
-
- Age prediction
|
| 188 |
-
- Emotion recognition (MER2023)
|
| 189 |
-
|
| 190 |
-
<p align="center">
|
| 191 |
-
<img src="images/table4.png" width="65%"/>
|
| 192 |
-
</p>
|
| 193 |
-
|
| 194 |
-
---
|
| 195 |
|
| 196 |
### Speech-to-Text Chat (STTC) Capability
|
| 197 |
|
| 198 |
We further evaluate the model in conversational reasoning scenarios.
|
| 199 |
|
| 200 |
-
|
| 201 |
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
We compare direct joint training with our decoupled-then-integrated strategy to verify the effectiveness of our core design.
|
| 211 |
-
|
| 212 |
-
<p align="center">
|
| 213 |
-
<img src="images/table6.png" width="65%"/>
|
| 214 |
-
</p>
|
| 215 |
-
|
| 216 |
-
Conclusion:
|
| 217 |
|
| 218 |
-
Text-domain intent pretraining (Stage 2) establishes a strong semantic prior for the model and is crucial for improving instruction-following stability.
|
| 219 |
|
| 220 |
---
|
| 221 |
|
| 222 |
-
## How to Use the
|
| 223 |
|
| 224 |
### Environment Setup
|
| 225 |
|
|
@@ -232,12 +226,12 @@ https://blog.csdn.net/qq_41636123/article/details/130266232
|
|
| 232 |
|
| 233 |
```bash
|
| 234 |
# Create a new conda environment
|
| 235 |
-
conda create -n
|
| 236 |
-
conda activate
|
| 237 |
|
| 238 |
# Clone the repository
|
| 239 |
-
git clone https://github.com/ASLP-lab/
|
| 240 |
-
cd
|
| 241 |
|
| 242 |
# Install dependencies
|
| 243 |
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
|
@@ -247,16 +241,15 @@ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
|
| 247 |
```python
|
| 248 |
from huggingface_hub import snapshot_download
|
| 249 |
|
| 250 |
-
# 下载Qwen2-Audio-7B模型
|
| 251 |
snapshot_download(
|
| 252 |
-
repo_id="ASLP-lab/
|
| 253 |
local_dir="path",
|
| 254 |
local_dir_use_symlinks=False,
|
| 255 |
endpoint="https://hf-mirror.com"
|
| 256 |
)
|
| 257 |
```
|
| 258 |
### Inference
|
| 259 |
-
This project provides batch inference scripts for all tasks under in :
|
| 260 |
|
| 261 |
```shell
|
| 262 |
python infer_ASR.py
|
|
@@ -272,11 +265,11 @@ Recommended: shard format
|
|
| 272 |
|
| 273 |
After preparing the dataset, write the generated data index into the following configuration file:
|
| 274 |
```yaml
|
| 275 |
-
|
| 276 |
```
|
| 277 |
#### 2. Start Training
|
| 278 |
|
| 279 |
Run the main training script:
|
| 280 |
```bash
|
| 281 |
-
|
| 282 |
```
|
|
|
|
| 1 |
<p align="center">
|
| 2 |
+
<h1>OSUM-Pangu: An Open-Source Multidimension Speech Understanding Foundation Model Built upon OpenPangu on Ascend NPUs</h1>
|
| 3 |
<p>
|
| 4 |
|
| 5 |
+
Yujie Liao, Xuelong Geng, Hongfei Xue, Shuiyuan Wang, Lei Xie
|
| 6 |
|
| 7 |
<p align="center">
|
| 8 |
+
<img src="images/OSUM-Pangu.jpg" width="400"/>
|
| 9 |
<p>
|
| 10 |
|
| 11 |
<p align="center">
|
| 12 |
+
<a href="https://github.com/ASLP-lab/OSUM-Pangu"> Code | <a href="https://arxiv.org/abs/2603.10862"> Paper</a>
|
| 13 |
</p>
|
| 14 |
|
| 15 |
+
Recent advancements in Speech Large Language Models have significantly enhanced multi-dimensional speech understanding. However, the majority of high-performance frameworks are predominantly optimized for GPU centric ecosystems and proprietary backbones, creating a significant gap for deployment on non-CUDA computing infrastructures. In this paper, we present OSUM-Pangu, a fully open-source speech understanding foundation model developed on a completely non-CUDA software and hardware stack. By integrating an audio encoder with the openPangu-7B LLM backbone, we successfully implement the entire training and inference pipeline on the Ascend NPU platform. To facilitate efficient task alignment under non-CUDA resource constraints, we adopt a practical training process that sequentially bridges speech perception and user intent recognition. Experimental results demonstrate that OSUM-Pangu achieves task accuracy comparable to mainstream GPU-based models while maintaining robust natural language interaction capabilities. Our work provides a reproducible, non-CUDA baseline for the open-source speech community, promoting the independent evolution of multimodal intelligence.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
---
|
| 18 |
|
| 19 |
## Architecture
|
| 20 |
|
| 21 |
+
The overall architecture of OSUM-Pangu is shown below:
|
| 22 |
|
| 23 |
<p align="center">
|
| 24 |
+
<img src="images/architecture1.png" width="80%"/>
|
| 25 |
<p>
|
| 26 |
|
| 27 |
The model mainly consists of three components:
|
|
|
|
| 34 |
Transforms acoustic features into tokens compatible with the LLM input space.
|
| 35 |
|
| 36 |
### 3. Intent-aware LLM
|
| 37 |
+
|
| 38 |
+
<p>
|
| 39 |
+
<a href="https://huggingface.co/FreedomIntelligence/openPangu-Embedded-7B-V1.1"> openPangu-Embedded-7B-V1.1 </a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
|
| 43 |
Responsible for:
|
| 44 |
- Parsing natural language instructions
|
|
|
|
| 49 |
|
| 50 |
## Training Strategy
|
| 51 |
|
| 52 |
+
We adopt a a three-stage training proces, illustrated below:
|
| 53 |
|
| 54 |
<p align="center">
|
| 55 |
<img src="images/Strategy.png" width="80%"/>
|
|
|
|
| 101 |
|
| 102 |
---
|
| 103 |
|
| 104 |
+
## Results
|
| 105 |
|
| 106 |
### Dataset Configuration
|
| 107 |
|
| 108 |
+
Our experiments follow the task definitions of the OSUM framework. To maintain the linguistic reasoning capability of the backbone, we incorporate 2M entries from Alpaca-CoT for text-based interactions, with queries synthesized using CosyVoice 2. To evaluate the model's robustness in real-world scenarios, we utilize an Intent-Instruction Set (IIS) containing over 80k training samples and 4k test prompts, covering diverse colloquial user queries.
|
| 109 |
|
| 110 |
+
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
### Multi-task Speech Understanding Performance
|
| 114 |
+
|
| 115 |
+
OSUM-Pangu demonstrates competitive performance across diverse tasks compared to GPU-based baselines Qwen2-Audio and OSUM, proving the effectiveness of the NPU-based pipeline.
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
| Task | Model | Public Test Set | Metric | Public Result |
|
| 119 |
+
|------------|----------------|---------------------------------------------------------------------------------|--------------|-------------------------------------------------------------------------------|
|
| 120 |
+
| **ASR** | Qwen2-Audio | | WER/CER (%) | 8.84 / 8.40 <br> 3.0 / 3.0 / 2.9 <br> **1.6 / 3.6** |
|
| 121 |
+
| | OSUM | WenetSpeech(n/m) <br> AISHELL-2(m/i/a) <br> LibriSpeech (c/o) | | 6.46 / **5.34** <br> **2.81 / 2.75 / 2.73** <br> 2.19 / 5.53 |
|
| 122 |
+
| | **OSUM-Pangu** | | | 7.40 / 10.49 <br> 3.01 / 2.98 / 2.95 <br> 3.51 / 8.36 |
|
| 123 |
+
| **VED** | Qwen2-Audio | VocalSound | ACC (%) | **93.3** |
|
| 124 |
+
| | OSUM | | | 82.58 |
|
| 125 |
+
| | **OSUM-Pangu** | | | 73.04 |
|
| 126 |
+
| **SER** | Qwen2-Audio | MELD-test <br> MER2023 | ACC (%) | 55.3 / -- |
|
| 127 |
+
| | OSUM | | | 53.38 / 86.43 |
|
| 128 |
+
| | **OSUM-Pangu** | | | 36.40 / **89.19** |
|
| 129 |
+
| **SGC** | Qwen2-Audio | Kaggle-CommonVoice test | ACC (%) | 97.25 |
|
| 130 |
+
| | OSUM | | | **99.41** |
|
| 131 |
+
| | **OSUM-Pangu** | | | 97.48 |
|
| 132 |
+
| **SAP** | Qwen2-Audio | Kaggle-CommonVoice test | ACC (%) | 35.53 |
|
| 133 |
+
| | OSUM | | | 76.52 |
|
| 134 |
+
| | **OSUM-Pangu** | | | **83.31** |
|
| 135 |
|
| 136 |
---
|
| 137 |
|
|
|
|
| 149 |
|
| 150 |
- $N_{correct}$ represents the number of correctly executed instructions
|
| 151 |
- $N_{total}$ represents the total number of evaluation samples
|
| 152 |
+
Compared with mainstream open-source models, OSUM-Pangu achieves significantly better performance:
|
| 153 |
|
|
|
|
| 154 |
|
| 155 |
+
| Model | IFR (\%) |
|
| 156 |
+
|---------------------------|-----------|
|
| 157 |
+
| Qwen2Audio-Instruct | 71.3 |
|
| 158 |
+
| **OSUM-Pangu (Ours)** | **90.2** |
|
| 159 |
|
| 160 |
---
|
| 161 |
|
|
|
|
| 165 |
|
| 166 |
Results show that the model maintains strong flexibility while preserving task accuracy.
|
| 167 |
|
| 168 |
+
|
| 169 |
+
| Task | Test | FI | NL | $\Delta$ |
|
| 170 |
+
|:---- |:---------------------------- |:-------- |:-------- |:--------- |
|
| 171 |
+
| ASR | test-net/librispeech-clean | 7.36/3.64 | 7.40/3.51 | +0.04/-0.13 |
|
| 172 |
+
| SER | Test<sub>emotion</sub> | 67.39 | 67.41 | +0.02 |
|
| 173 |
+
| SGC | Test<sub>gender</sub> | 97.04 | 96.02 | -1.02 |
|
| 174 |
+
| SRWT | Test<sub>align</sub> | 22.39 | 17.52 | -4.87 |
|
| 175 |
+
| SSR | Test<sub>style</sub> | 62.79 | 58.05 | -4.74 |
|
| 176 |
+
| VED | Test<sub>event</sub> | 77.74 | 73.04 | -4.70 |
|
| 177 |
+
| SAP | Test<sub>age</sub> | 71.75 | 72.86 | +0.11 |
|
| 178 |
+
|
| 179 |
+
---
|
| 180 |
|
| 181 |
Conclusion:
|
| 182 |
|
|
|
|
| 191 |
- SER
|
| 192 |
- SAP
|
| 193 |
|
| 194 |
+
remain almost unchanged, validating the effectiveness of the three-stage training process.
|
| 195 |
|
| 196 |
---
|
| 197 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
### Speech-to-Text Chat (STTC) Capability
|
| 200 |
|
| 201 |
We further evaluate the model in conversational reasoning scenarios.
|
| 202 |
|
| 203 |
+
OSUM-Pangu outperforms GLM-4-Voice on the TriviaQA and WebQ benchmarks.
|
| 204 |
|
| 205 |
+
| Model | LLaMA Q | TriviaQA | Web Q |
|
| 206 |
+
|:------------------ |:------: |:-------: |:----: |
|
| 207 |
+
| ChatGPT-4o | 71.7 | 69.7 | 51.6 |
|
| 208 |
+
| GLM-4-Voice | 50.7 | 26.5 | 15.9 |
|
| 209 |
+
| DeepTalk | 59.7 | 27.5 | 23.1 |
|
| 210 |
+
| OSUM-EChat | 55.3 | 33.7 | 30.4 |
|
| 211 |
+
| **OSUM-Pangu** | 44.6 | 28.9 | 29.5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
|
|
|
|
| 213 |
|
| 214 |
---
|
| 215 |
|
| 216 |
+
## How to Use the OSUM-Pangu Framework for Training and Inference
|
| 217 |
|
| 218 |
### Environment Setup
|
| 219 |
|
|
|
|
| 226 |
|
| 227 |
```bash
|
| 228 |
# Create a new conda environment
|
| 229 |
+
conda create -n osum_pangu python=3.10
|
| 230 |
+
conda activate osum_pangu
|
| 231 |
|
| 232 |
# Clone the repository
|
| 233 |
+
git clone https://github.com/ASLP-lab/OSUM-Pangu.git
|
| 234 |
+
cd OSUM-Pangu
|
| 235 |
|
| 236 |
# Install dependencies
|
| 237 |
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
|
|
|
| 241 |
```python
|
| 242 |
from huggingface_hub import snapshot_download
|
| 243 |
|
|
|
|
| 244 |
snapshot_download(
|
| 245 |
+
repo_id="ASLP-lab/OSUM-Pangu",
|
| 246 |
local_dir="path",
|
| 247 |
local_dir_use_symlinks=False,
|
| 248 |
endpoint="https://hf-mirror.com"
|
| 249 |
)
|
| 250 |
```
|
| 251 |
### Inference
|
| 252 |
+
This project provides batch inference scripts for all tasks under in :OSUM-Pangu/infer_code:
|
| 253 |
|
| 254 |
```shell
|
| 255 |
python infer_ASR.py
|
|
|
|
| 265 |
|
| 266 |
After preparing the dataset, write the generated data index into the following configuration file:
|
| 267 |
```yaml
|
| 268 |
+
OSUM-Pangu/conf/data_s2t_tmp.yaml
|
| 269 |
```
|
| 270 |
#### 2. Start Training
|
| 271 |
|
| 272 |
Run the main training script:
|
| 273 |
```bash
|
| 274 |
+
OSUM-Pangu/train.sh
|
| 275 |
```
|
images/OSUM-Pangu.jpg
ADDED
|
Git LFS Details
|
images/architecture1.png
ADDED
|
Git LFS Details
|