add deploy model
This commit is contained in:
@@ -44,23 +44,7 @@ aha = { git = "https://github.com/jhqxxx/aha.git", features = ["cuda"] }
|
||||
aha = { git = "https://github.com/jhqxxx/aha.git", features = ["cuda", "flash-attn"] }
|
||||
```
|
||||
|
||||
### 从源码构建运行测试
|
||||
```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
|
||||
```
|
||||
|
||||
## 使用方法
|
||||
### VoxCPM示例
|
||||
#### VoxCPM使用示例
|
||||
```rust
|
||||
use aha::models::voxcpm::generate::VoxCPMGenerate;
|
||||
use aha::utils::audio_utils::save_wav;
|
||||
@@ -88,6 +72,77 @@ 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:MiniCPM4-0.5B 模型
|
||||
* qwen2.5vl-3b:Qwen2.5-VL-3B 模型
|
||||
* qwen3vl-2b:Qwen3-VL-2B 模型
|
||||
* 示例:--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)
|
||||
|
||||
## 开发
|
||||
### 项目结构
|
||||
|
||||
Reference in New Issue
Block a user