merge deploy

This commit is contained in:
jhqxxx
2025-11-27 14:28:47 +08:00
16 changed files with 788 additions and 54 deletions
+76 -1
View File
@@ -26,7 +26,7 @@
* ubuntu/WSL
```bash
sudo apt-get update
sudo apt-get install -y pkg-config ffmpeg libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libswresample-dev libswscale-dev
sudo apt-get install -y clang pkg-config ffmpeg libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libswresample-dev libswscale-dev
```
* windows参考: https://github.com/zmwangx/rust-ffmpeg/wiki/Notes-on-building
@@ -92,6 +92,81 @@ fn main() -> Result<()> {
}
```
### 从源码构建运行测试
```bash
git clone https://github.com/jhqxxx/aha.git
cd aha
# 修改测试用例中模型路径
# 运行 Qwen3VL 示例
cargo test -F cuda qwen3vl_generate -- --nocapture
# 运行 MiniCPM4 示例
cargo test -F cuda minicpm_generate -- --nocapture
# 运行 VoxCPM 示例
cargo test -F cuda voxcpm_generate -- --nocapture
```
### 从源码构建部署
```bash
git clone https://github.com/jhqxxx/aha.git
cd aha
git checkout deploy
```
#### cargo run 运行参数说明
##### 基本用法
```bash
cargo run -F cuda -- [参数]
```
##### 参数详解
1. 端口设置
-----
-p, --port <PORT>
* 设置HTTP服务监听的端口号
* 默认值:10100
* 示例:--port 8080 或 -p 8080
2. 模型选择(必选)
-----
-m, --model <MODEL>
* 指定要加载的模型类型
* 可选值:
* minicpm4-0.5b:OpenBMB/MiniCPM4-0.5B 模型
* qwen2.5vl-3b:Qwen/Qwen2.5-VL-3B-Instruct 模型
* qwen2.5vl-7b:Qwen/Qwen2.5-VL-7B-Instruct 模型
* qwen3vl-2b:Qwen/Qwen3-VL-2B-Instruct 模型
* qwen3vl-4b:Qwen/Qwen3-VL-4B-Instruct 模型
* qwen3vl-8b:Qwen/Qwen3-VL-8B-Instruct 模型
* qwen3vl-32b:Qwen/Qwen3-VL-32B-Instruct 模型
* 示例:--model minicpm4-0.5b 或 -m qwen3vl-2b
3. 权重路径
-----
--weight-path <WEIGHT_PATH>
* 指定本地模型权重文件路径
* 如果指定此参数,则跳过模型下载步骤
* 示例:--weight-path /path/to/model/dir
4. 保存路径
-----
--save-dir <SAVE_DIR>
* 指定模型下载保存的目录
* 默认保存在用户主目录下的 .aha 文件夹中
* 示例:--save-dir /custom/model/path
5. 下载重试次数
-----
--download-retries <DOWNLOAD_RETRIES>
* 设置模型下载失败时的最大重试次数
* 默认值:3次
* 示例:--download-retries 5
##### 注意事项
* 参数前需要使用双横线 -- 分隔 cargo 命令和应用程序参数
* 模型参数 (--model 或 -m) 是必需的
* 如果未指定 --weight-path,程序会自动下载指定模型
* 下载的模型默认保存在 ~/.aha/ 目录下(除非指定了 --save-dir)
## 开发
### 项目结构