Merge branch 'dev' of github.com:m5stack/StackFlow into dev

This commit is contained in:
dianjixz
2025-04-29 11:22:05 +08:00
35 changed files with 273 additions and 99 deletions
+39
View File
@@ -0,0 +1,39 @@
# Results
## ModuleLLM (AX630C)
### LLM
| model | ttft (ms) | avg-token/s | model version | llm version |
|---------------------------------|------------|-------------|---------------|-------------|
| qwen2.5-0.5B-prefill-20e | 359.8 | 10.32 | v0.2 | v1.8 |
| qwen2.5-0.5B-p256-ax630c | 1126.19 | 10.30 | v0.4 | v1.8 |
| qwen2.5-0.5B-Int4-ax630c | 442.95 | 12.52 | v0.4 | v1.8 |
| qwen2.5-coder-0.5B-ax630c | 361.81 | 10.28 | v0.2 | v1.8 |
| qwen2.5-1.5B-ax630c | 1029.41 | 3.59 | v0.3 | v1.8 |
| qwen2.5-1.5B-p256-ax630c | 3056.54 | 3.57 | v0.4 | v1.8 |
| qwen2.5-1.5B-Int4-ax630c | 1219.54 | 4.63 | v0.4 | v1.8 |
| deepseek-r1-1.5B-ax630c | 1075.04 | 3.57 | v0.3 | v1.8 |
| deepseek-r1-1.5B-p256-ax630c | 3056.86 | 3.57 | v0.4 | v1.8 |
| llama3.2-1B-prefill-ax630c | 891.00 | 4.48 | v0.2 | v1.8 |
| llama3.2-1B-p256-ax630c | 2601.11 | 4.49 | v0.4 | v1.8 |
| openbuddy-llama3.2-1B-ax630c | 891.02 | 4.52 | v0.2 | v1.8 |
`The input text used by the llm test is "hello!“`
### VLM
| model | ttft (ms) | avg-token/s | image encode (ms) | model version | vlm version |
|---------------------------------|------------|-------------|-------------------|---------------|-------------|
| internvl2.5-1B-364-ax630c | 1117.27 | 10.56 | 1164.61 | v0.4 | v1.7 |
| smolvlm-256M-ax630c | 185.75 | 30.16 | 799.11 | v0.4 | v1.7 |
| smolvlm-500M-ax630c | 365.69 | 13.14 | 838.30 | v0.4 | v1.7 |
`The image encoding test uses a jpg image with a size of 810*1080`
### STT
| model | encode (ms) | avg-decode (ms) | model version | whisper version |
|--------------------|-------------|-----------------|---------------|-----------------|
| whisper-tiny | 248.0 | 32.54 | v0.4 | v1.7 |
| whisper-base | 660.31 | 51.11 | v0.4 | v1.7 |
| whisper-small | 1606.08 | 148.92 | v0.4 | v1.7 |
`The STT test uses a 30-second wav English audio`
+1 -1
View File
@@ -7,7 +7,7 @@ import logging
from pathlib import Path
from utils.llm import LLMClient
from utils import LLMClient
FILE = Path(__file__).resolve()
ROOT = FILE.parents[0]
+3
View File
@@ -0,0 +1,3 @@
from .llm import LLMClient
__all__ = ["LLMClient"]
+1 -9
View File
@@ -30,7 +30,6 @@ class LLMClient:
while True:
chunk = self.sock.recv(4096)
logging.info(f"Received chunk: {chunk}")
response += chunk
while b'\n' in response:
@@ -149,21 +148,14 @@ class LLMClient:
def test(self, model, input_text):
logging.info("Setting up...")
setup_response = self.setup(model)
logging.info("Setup response: %s", setup_response)
logging.info("Running inference...")
inference_result = self.inference(input_text)
logging.info("Inference result: %s", inference_result)
logging.info("Exiting...")
exit_response = self.exit()
logging.info("Exit response: %s", exit_response)
return {
"setup_response": setup_response,
"inference_result": inference_result,
"exit_response": exit_response
}
return {}
if __name__ == "__main__":
host = "192.168.20.186"
+3 -3
View File
@@ -119,9 +119,9 @@ Example:
"endpoint_config.rule1.min_trailing_silence": 2.4,
"endpoint_config.rule2.min_trailing_silence": 1.2,
"endpoint_config.rule3.min_trailing_silence": 30.1,
"endpoint_config.rule1.must_contain_nonsilence": false,
"endpoint_config.rule2.must_contain_nonsilence": false,
"endpoint_config.rule3.must_contain_nonsilence": false
"endpoint_config.rule1.must_contain_nonsilence": true,
"endpoint_config.rule2.must_contain_nonsilence": true,
"endpoint_config.rule3.must_contain_nonsilence": true
}
}
```
+3 -3
View File
@@ -117,9 +117,9 @@ error::code 为 0 表示执行成功。
"endpoint_config.rule1.min_trailing_silence": 2.4,
"endpoint_config.rule2.min_trailing_silence": 1.2,
"endpoint_config.rule3.min_trailing_silence": 30.1,
"endpoint_config.rule1.must_contain_nonsilence": false,
"endpoint_config.rule2.must_contain_nonsilence": false,
"endpoint_config.rule3.must_contain_nonsilence": false
"endpoint_config.rule1.must_contain_nonsilence": true,
"endpoint_config.rule2.must_contain_nonsilence": true,
"endpoint_config.rule3.must_contain_nonsilence": true
}
}
```
@@ -27,7 +27,7 @@ Send JSON:
- work_id: When configuring the unit, it is `depth_anything`.
- action: The method called is `setup`.
- object: The data type being transmitted is `depth_anything.setup`.
- model: The model used is the `depth_anything` model.
- model: The model used is the `depth-anything-ax630c` model.
- response_format: The return result is `jpeg.base64.stream`.
- input: The input is `camera.1001`, which refers to the input from the camera unit, as detailed in the camera unit
documentation.
@@ -27,7 +27,7 @@ depth_anything 视觉单元,用于提供图片深度信息。
- work_id:配置单元时,为 `depth_anything`
- action:调用的方法为 `setup`
- object:传输的数据类型为 `depth_anything.setup`
- model:使用的模型为 `depth_anything` 模型。
- model:使用的模型为 `depth-anything-ax630c` 模型。
- response_format:返回结果为 `jpeg.base64.stream`
- input:输入的为 `camera.1001`,代表的是从 camera 单元内部输入,详见 camera 单位文档。
- enoutput:是否启用用户结果输出。
@@ -16,7 +16,7 @@ Send JSON:
"action": "setup",
"object": "melotts.setup",
"data": {
"model": "melotts_zh-cn",
"model": "melotts-en-us",
"response_format": "sys.pcm",
"input": "tts.utf-8",
"enoutput": false
@@ -28,7 +28,7 @@ Send JSON:
- work_id: For configuration, it is `melotts`.
- action: The method to be called is `setup`.
- object: The data type being transmitted is `melotts.setup`.
- model: The model being used is the Chinese model `melotts_zh-cn`.
- model: The model being used is the English model `melotts-en-us`.
- response_format: The result is returned as `sys.pcm`, system audio data, which is directly sent to the llm-audio
module for playback.
- input: The input is `tts.utf-8`, representing user input.
@@ -139,7 +139,7 @@ Example:
"action": "setup",
"object": "melotts.setup",
"data": {
"model": "melotts_zh-cn",
"model": "melotts-en-us",
"response_format": "sys.pcm",
"input": [
"tts.utf-8",
@@ -335,7 +335,7 @@ Response JSON:
"inputs_": [
"tts.utf-8"
],
"model": "melotts_zh-cn",
"model": "melotts-en-us",
"response_format": "sys.pcm"
},
"error": {
@@ -15,7 +15,7 @@
"action": "setup",
"object": "melotts.setup",
"data": {
"model": "melotts_zh-cn",
"model": "melotts-zh-cn",
"response_format": "sys.pcm",
"input": "tts.utf-8",
"enoutput": false
@@ -27,7 +27,7 @@
- work_id:配置单元时,为 `melotts`
- action:调用的方法为 `setup`
- object:传输的数据类型为 `melotts.setup`
- model:使用的模型为 `melotts_zh-cn` 中文模型。
- model:使用的模型为 `melotts-zh-cn` 中文模型。
- response_format:返回结果为 `sys.pcm`, 系统音频数据,并直接发送到 llm-audio 模块进行播放。
- input:输入的为 `tts.utf-8`,代表的是从用户输入。
- enoutput:是否起用用户结果输出。
@@ -134,7 +134,7 @@ error::code 为 0 表示执行成功。
"action": "setup",
"object": "melotts.setup",
"data": {
"model": "melotts_zh-cn",
"model": "melotts-zh-cn",
"response_format": "sys.pcm",
"input": [
"tts.utf-8",
@@ -328,7 +328,7 @@ error::code 为 0 表示执行成功。
"inputs_": [
"tts.utf-8"
],
"model": "melotts_zh-cn",
"model": "melotts-zh-cn",
"response_format": "sys.pcm"
},
"error": {
+42 -5
View File
@@ -16,7 +16,7 @@ Send JSON:
"action": "setup",
"object": "tts.setup",
"data": {
"model": "single_speaker_fast",
"model": "single-speaker-english-fast",
"response_format": "sys.pcm",
"input": "tts.utf-8",
"enoutput": false
@@ -28,7 +28,7 @@ Send JSON:
- work_id: For configuring the unit, it is `tts`.
- action: The method to call is `setup`.
- object: The type of data being transmitted is `tts.setup`.
- model: The model used is the `single_speaker_fast` Chinese model.
- model: The model used is the `single-speaker-english-fast` English model.
- response_format: The returned result is `sys.pcm`, system audio data, which is directly sent to the llm-audio module
for playback.
- input: Input is `tts.utf-8`, representing user input.
@@ -46,13 +46,50 @@ Response JSON:
},
"object": "None",
"request_id": "2",
"work_id": "llm.1003"
"work_id": "tts.1003"
}
```
- created: Message creation time, in Unix time.
- work_id: The successfully created work_id unit.
## inference
### streaming input
```json
{
"request_id": "2",
"work_id": "tts.1003",
"action": "inference",
"object": "tts.utf-8.stream",
"data": {
"delta": "What's ur name?",
"index": 0,
"finish": true
}
}
```
- object: The data type transmitted is tts.utf-8.stream, indicating a streaming input from the user's UTF-8.
- delta: Segment data of the streaming input.
- index: Index of the segment in the streaming input.
- finish: A flag indicating whether the streaming input has completed.
### non-streaming input
```json
{
"request_id": "2",
"work_id": "tts.1003",
"action": "inference",
"object": "tts.utf-8",
"data": "What's ur name?"
}
```
- object: The data type transmitted is tts.utf-8, indicating a non-streaming input from the user's UTF-8.
- data: Data for non-streaming input.
## link
Link the output of the upper unit.
@@ -102,7 +139,7 @@ Example:
"action": "setup",
"object": "tts.setup",
"data": {
"model": "single_speaker_fast",
"model": "single-speaker-fast",
"response_format": "sys.pcm",
"input": [
"tts.utf-8",
@@ -298,7 +335,7 @@ Response JSON:
"inputs_": [
"tts.utf-8"
],
"model": "single_speaker_fast",
"model": "single-speaker-fast",
"response_format": "sys.pcm"
},
"error": {
+41 -5
View File
@@ -15,7 +15,7 @@
"action": "setup",
"object": "tts.setup",
"data": {
"model": "single_speaker_fast",
"model": "single-speaker-fast",
"response_format": "sys.pcm",
"input": "tts.utf-8",
"enoutput": false
@@ -27,7 +27,7 @@
- work_id:配置单元时,为 `tts`
- action:调用的方法为 `setup`
- object:传输的数据类型为 `tts.setup`
- model:使用的模型为 `single_speaker_fast` 中文模型。
- model:使用的模型为 `single-speaker-fast` 中文模型。
- response_format:返回结果为 `sys.pcm`, 系统音频数据,并直接发送到 llm-audio 模块进行播放。
- input:输入的为 `tts.utf-8`,代表的是从用户输入。
- enoutput:是否起用用户结果输出。
@@ -44,13 +44,49 @@
},
"object": "None",
"request_id": "2",
"work_id": "llm.1003"
"work_id": "tts.1003"
}
```
- created:消息创建时间,unix 时间。
- work_id:返回成功创建的 work_id 单元。
## inference
### 流式输入
```json
{
"request_id": "2",
"work_id": "tts.1003",
"action": "inference",
"object": "tts.utf-8.stream",
"data": {
"delta": "今天天气真好!",
"index": 0,
"finish": true
}
}
```
- object:传输的数据类型为 `tts.utf-8.stream` 代表的是从用户 utf-8 的流式输入
- delta:流式输入的分段数据
- index:流式输入的分段索引
- finish:流式输入是否完成的标志位
### 非流式输入
```json
{
"request_id": "2",
"work_id": "tts.1003",
"action": "inference",
"object": "tts.utf-8",
"data": "今天天气真好!"
}
```
- object:传输的数据类型为 `tts.utf-8` 代表的是从用户 utf-8 的非流式输入
- data:非流式输入的数据
## link
链接上级单元的输出。
@@ -98,7 +134,7 @@ error::code 为 0 表示执行成功。
"action": "setup",
"object": "tts.setup",
"data": {
"model": "single_speaker_fast",
"model": "single-speaker-fast",
"response_format": "sys.pcm",
"input": [
"tts.utf-8",
@@ -294,7 +330,7 @@ error::code 为 0 表示执行成功。
"inputs_": [
"tts.utf-8"
],
"model": "single_speaker_fast",
"model": "single-speaker-fast",
"response_format": "sys.pcm"
},
"error": {
+1 -1
View File
@@ -26,7 +26,7 @@ REQUIREMENTS += ['ncnn', 'sherpa-ncnn-core']
STATIC_FILES += Glob('mode_*.json')
env['COMPONENTS'].append({'target':'llm_asr-1.5',
env['COMPONENTS'].append({'target':'llm_asr-1.6',
'SRCS':SRCS,
'INCLUDE':INCLUDE,
'PRIVATE_INCLUDE':PRIVATE_INCLUDE,
+1 -1
View File
@@ -29,7 +29,7 @@ REQUIREMENTS += ['tinyalsa', 'opus', 'samplerate', 'fdk-aac']
STATIC_FILES += [AFile('audio.json')]
STATIC_FILES += Glob('mode_*.json')
env['COMPONENTS'].append({'target':'llm_audio-1.5',
env['COMPONENTS'].append({'target':'llm_audio-1.6',
'SRCS':SRCS,
'INCLUDE':INCLUDE,
'PRIVATE_INCLUDE':PRIVATE_INCLUDE,
@@ -68,7 +68,7 @@ STATIC_LIB += static_file * 4
STATIC_FILES += [AFile('camera.json')]
STATIC_FILES += Glob('mode_*.json')
env['COMPONENTS'].append({'target':'llm_camera-1.7',
env['COMPONENTS'].append({'target':'llm_camera-1.8',
'SRCS':SRCS,
'INCLUDE':INCLUDE,
'PRIVATE_INCLUDE':PRIVATE_INCLUDE,
@@ -30,7 +30,7 @@ STATIC_LIB += static_file * 2
STATIC_FILES += Glob('mode_*.json')
env['COMPONENTS'].append({'target':'llm_depth_anything-1.5',
env['COMPONENTS'].append({'target':'llm_depth_anything-1.6',
'SRCS':SRCS,
'INCLUDE':INCLUDE,
'PRIVATE_INCLUDE':PRIVATE_INCLUDE,
@@ -1,7 +1,9 @@
{
"mode":"depth_anything",
"mode":"depth-anything-ax630c",
"type":"cv",
"homepage":"https://github.com/DepthAnything/Depth-Anything-V2",
"compile_flage":"pulsar2 build --input depth_anything.onnx --config config.json --output_dir output --output_name depth_anything.axmodel --target_hardware AX620E",
"pulsar_version":"2.5-2d5d0fa3",
"capabilities":[
"Segmentation"
],
+1 -1
View File
@@ -55,7 +55,7 @@ ignore['ignore'] = list(set(ignore['ignore']))
with open('../dist/fileignore', 'w') as f:
json.dump(ignore, f, indent=4)
env['COMPONENTS'].append({'target':'llm_kws-1.6',
env['COMPONENTS'].append({'target':'llm_kws-1.7',
'SRCS':SRCS,
'INCLUDE':INCLUDE,
'PRIVATE_INCLUDE':PRIVATE_INCLUDE,
+1 -1
View File
@@ -66,7 +66,7 @@ ignore['ignore'] = list(set(ignore['ignore']))
with open('../dist/fileignore', 'w') as f:
json.dump(ignore, f, indent=4)
env['COMPONENTS'].append({'target':'llm_llm-1.7',
env['COMPONENTS'].append({'target':'llm_llm-1.8',
'SRCS':SRCS,
'INCLUDE':INCLUDE,
'PRIVATE_INCLUDE':PRIVATE_INCLUDE,
@@ -31,7 +31,7 @@ LDFLAGS += ['-l:libcargs.a', '-l:libonnxruntime.a']
STATIC_FILES += Glob('mode_*.json')
env['COMPONENTS'].append({'target':'llm_melotts-1.6',
env['COMPONENTS'].append({'target':'llm_melotts-1.7',
'SRCS':SRCS,
'INCLUDE':INCLUDE,
'PRIVATE_INCLUDE':PRIVATE_INCLUDE,

Some files were not shown because too many files have changed in this diff Show More