HY-2012 commited on
Commit
d835364
·
verified ·
1 Parent(s): 133dad9

Delete README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -218
README.md DELETED
@@ -1,218 +0,0 @@
1
- ---
2
- license: mit
3
- language:
4
- - en
5
- - zh
6
- pipeline_tag: audio-to-audio
7
- base_model:
8
- - FunAudioLLM/SenseVoiceSmall
9
- - qwen2.5
10
- - MeloTTS
11
- tags:
12
- - VAD
13
- - ASR
14
- - LLM
15
- - TTS
16
- ---
17
-
18
-
19
- # Spoken-Communication.axera
20
-
21
- spoken communication demo on Axera
22
-
23
- - [x] Python 示例
24
- - [ ] C++ 示例
25
-
26
- ## Convert tools links:
27
-
28
- For those who are interested in model conversion, you can try to export axmodel through the original repo :
29
- How to Convert from ONNX to axmodel
30
- - [ASR](https://github.com/AXERA-TECH/3D-Speaker-MT.axera/tree/main/model_convert)
31
- - [MeloTTS](https://github.com/ml-inory/melotts.axera/tree/main/model_convert)
32
-
33
- ## 支持平台
34
-
35
- - AX650N
36
-
37
- ## 功能
38
-
39
- 语音交流
40
-
41
- ## Pipeline组件
42
-
43
- - [ASR](https://github.com/AXERA-TECH/3D-Speaker-MT.axera/tree/main)
44
- - [LLM](https://github.com/AXERA-TECH/ax-llm/tree/ax-context),参考生成库文件,保存到libaxllm
45
- - [MeloTTS](https://github.com/ml-inory/melotts.axera/tree/main/python)
46
-
47
- ## 上板部署
48
-
49
- - AX650N 的设备已预装 Ubuntu22.04
50
- - 以 root 权限登陆 AX650N 的板卡设备
51
- - 链接互联网,确保 AX650N 的设备能正常执行 apt install, pip install 等指令
52
- - 已验证设备:AX650N DEMO Board
53
-
54
- ## Python API 运行
55
-
56
- 在python3.10(验证)
57
-
58
- ### pipeline方案:ASR + LLM(Qwen) + MeloTTS
59
-
60
- ```
61
- 支持板端运行及算力卡模式运行
62
- ```
63
-
64
- ### 工程下载
65
- ```
66
- git clone https://huggingface.co/AXERA-TECH/Spoken-Communication.axera 或者
67
- hf download AXERA-TECH/Spoken-Communication.axera --local-dir Spoken-Communication.axera
68
-
69
- cd Spoken-Communication.axera
70
-
71
- 工程目录文件结构如下:
72
- .
73
- |-- README.md
74
- |-- ax_model
75
- |-- ax_spoken_communication_demo.py
76
- |-- config.json
77
- |-- libaxllm
78
- |-- libmelotts
79
- |-- model.py
80
- |-- requirements.txt
81
- |-- utils
82
- `-- input_question
83
-
84
- ```
85
-
86
- ### 具体流程
87
-
88
- **板端 demo**
89
-
90
- 1、安装依赖库
91
-
92
- ```
93
- 1):
94
- 如果环境中没有axengine,下载安装,位置任意
95
- hf download AXERA-TECH/PyAXEngine --local-dir PyAXEngine
96
- cd PyAXEngine
97
- pip3 install axengine-0.1.3-py3-none-any.whl
98
-
99
- 2):
100
- cd Spoken-Communication.axera
101
- pip3 install -r requirements.txt
102
-
103
- 3):
104
- apt install espeak 或者
105
- sudo apt install espeak
106
- ```
107
-
108
- 2、模型下载
109
-
110
- 以Qwen2.5-1.5B为例,[下载地址](https://huggingface.co/AXERA-TECH/Qwen2.5-1.5B-Instruct/tree/main/qwen2.5-1.5b-ctx-ax650)
111
- ```
112
- 执行命令:
113
- hf download AXERA-TECH/Qwen2.5-1.5B-Instruct --local-dir libaxllm --include qwen2.5-1.5b-ctx-ax650/*
114
-
115
- 模型下载至libaxllm文件夹
116
- ```
117
-
118
- 3、在开发板运行以下命令
119
-
120
- ```
121
- 1)、运行qwen api
122
- cd libaxllm
123
-
124
- 启动支持上下文的 tokenizer 服务器
125
- python3 qwen2.5_tokenizer_uid.py
126
-
127
- 运行
128
- sh run_qwen2.5_1.5b_ctx_ax650_api.sh
129
-
130
- 2)、运行pipeline板端demo
131
- cd ..
132
-
133
- python3 ax_spoken_communication_demo.py --audio_dir input_question --output_dir output_answer --api_url http://10.126.29.158:8000
134
-
135
- 运行参数说明:
136
-
137
- | 参数名称 | 说明|
138
- |-------|------|
139
- | `--audio_dir` | 音频路径 |
140
- | `--api_url` | qwen API服务地址,对应其运行服务器 |
141
- | `--output_dir` | 结果保存路径 |
142
- ```
143
-
144
- 输出:
145
- 1、与输入音频相对应的wav文件,
146
- 2、识别信息保存成txt文件 -> "output_answer/processing_summary.txt",如下:
147
- ```
148
- 批量处理结果汇总
149
- ==================================================
150
-
151
- 文件 1: Q1.wav
152
- 原始文本: 人工智能和人类智能最本质的区别是什么?。
153
- 回答结果: 人工智能和人类智能最本质的区别在于,人工智能是基于算法和数据进行学习和决策的机器智能,而人类智能是基于经验和直觉进行思考和决策的生物智能。
154
- 合成音频: Q1_answer.wav
155
- 处理时间: 8.22 秒
156
- 音频时长: 15.19 秒
157
- RTF: 0.54
158
- --------------------------------------------------
159
- 文件 2: Q2.wav
160
- 原始文本: 人工智能没有思想,为什么他能创作出震撼人心的艺术?。
161
- 回答结果: 人工智能创作艺术是因为它可以通过算法和数据进行学习和分析,理解艺术作品的风格、情感和意义,然后通过生成模型进行创作。这与人类艺术家创作艺术的灵感、经验和直觉不同,但人工智能在某些领域已经表现出超越人类的能力。
162
- 合成音频: Q2_answer.wav
163
- 处理时间: 9.43 秒
164
- 音频时长: 23.68 秒
165
- RTF: 0.40
166
- --------------------------------------------------
167
- 文件 3: Q3.wav
168
- 原始文本: 人工智能最终会统治人类吗?。
169
- 回答结果: 人工智能的发展可能会对人类社会产生重大影响,但目前来看,人工智能尚未达到能够统治人类的程度。人工智能主要是在特定任务上表现出色,如数据分析、图像识别等,但在决策、伦理和情感理解等方面仍存在局限。
170
- 合成音频: Q3_answer.wav
171
- 处理时间: 8.86 秒
172
- 音频时长: 22.62 秒
173
- RTF: 0.39
174
- --------------------------------------------------
175
-
176
- 总计: 3 个文件
177
- 总处理时间: 26.53 秒
178
- ```
179
-
180
- 4、Latency
181
-
182
- AX650N
183
-
184
- RTF: 约��0.4,如上例。
185
-
186
-
187
- **算力卡demo**
188
-
189
- 运行步骤与板端demo大致相同,以aarch64环境为例:
190
- ```
191
- 1、运行qwen api
192
- cd libaxllm
193
-
194
- 启动支持上下文的 tokenizer 服务器
195
- python3 qwen2.5_tokenizer_uid.py
196
-
197
- 运行对应环境的api
198
- sh run_qwen2.5_1.5b_ctx_axcl_aarch64_api.sh
199
-
200
- 2、运行pipeline算力卡demo
201
- cd ..
202
- python3 ax_spoken_communication_demo.py --audio_dir input_question --api_url http://10.126.33.13:8000 --output_dir output
203
- ```
204
- x86环境运行步骤同上
205
-
206
-
207
-
208
- ## 参考
209
- - [sensevoice.axera](https://github.com/ml-inory/sensevoice.axera/tree/main)
210
- - [3D-Speaker.axera](https://github.com/AXERA-TECH/3D-Speaker.axera/tree/master)
211
- - [melotts.axera](https://github.com/ml-inory/melotts.axera/tree/main)
212
- - [ax-llm](https://github.com/AXERA-TECH/ax-llm/tree/ax-context)
213
-
214
-
215
- ## 技术讨论
216
-
217
- - Github issues
218
- - QQ 群: 139953715