Files
qiming/qiming-mcp-proxy/voice-cli/MODEL_VALIDATION_FIX.md
2026-06-01 13:03:20 +08:00

85 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 模型验证问题解决方案
## 问题描述
在下载 Whisper 模型时遇到验证失败的问题:
```
2025-08-25T10:17:08.839774Z WARN Model file does not have valid GGML or GGUF magic number
2025-08-25T10:17:08.839811Z ERROR Failed to download model 'base': Model error: Model 'base' validation failed
```
## 解决方案
**问题已修复!** 我们移除了过于严格的文件格式验证。现在系统只检查:
1.**文件存在性**:确保文件已下载
2.**文件大小**:确保不是空文件或过小文件
3.**文件可读性**:确保文件没有权限问题
**不再检查**
- ❌ GGML/GGUF 魔数验证
- ❌ 复杂的文件头格式检查
- ❌ 严格的版本号验证
## 为什么这样更好
1. **让专业工具处理**whisper.cpp 在加载时会自行验证模型格式
2. **减少误判**:避免因格式细节差异导致的验证失败
3. **更高容错性**:支持不同版本和变体的模型文件
4. **更快下载**:减少下载后的处理时间
## 使用方法
现在下载模型更加简单可靠:
```bash
# 直接下载模型
./voice-cli model download base
# 查看模型状态
./voice-cli model list
# 如果需要诊断
./voice-cli model diagnose base
```
## 诊断工具
如果遇到问题,诊断工具现在专注于实用信息:
```bash
./voice-cli model diagnose base
```
输出示例:
```
=== Model Diagnosis for 'base' ===
File size: 147951465 bytes (141.1 MB)
Expected size: 149422080 bytes (142.0 MB)
Size difference: 1.0%
✅ File size is within expected range
✅ File is readable
✅ File has reasonable size
```
## 修复建议
如果仍然有问题:
```bash
# 1. 删除可能损坏的文件
./voice-cli model remove base
# 2. 重新下载
./voice-cli model download base
# 3. 检查状态
./voice-cli model list
```
## 技术说明
- **文件格式验证**:交给 whisper.cpp 引擎处理
- **错误处理**:只在文件明显损坏时报错(如文件过小)
- **兼容性**:支持各种模型文件变体和版本