Files
audio2text/config.cpu.yaml
audio2text dev 73110848f4 feat: 调度器+并发管线+GPU优化+日志分级+前端修复
- scheduler: ffmpeg 异步线程 + GPU 串行调度 + 模型复用(2N→2 次加载)
- pipeline: 阶段拆分(extract/asr/translate),中间数据存 Task 字段
- translate_service: 长度排序批处理,padding 浪费减少 91%
- model_manager: ASR/翻译不共驻,BatchedInferencePipeline 批量解码
- 日志分级: INFO=任务流转里程碑,DEBUG=进度详情;默认 INFO
- 前端: 日志最新在上+滚动感知+退避轮询;24h 时间;上传中状态显示
- /health: 返回完整 Whisper/NLLB 配置
- upload_service: 单事务 complete + 扩展名白名单
- task_router: 合并 UploadSession 虚拟任务到列表
- Dockerfile: CPU/GPU 独立构建链,deps 缓存稳定
- prefetch_models: 安装时预下载模型权重
2026-07-06 21:59:59 +08:00

60 lines
1.9 KiB
YAML
Raw 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.

# audio2text — CPU 开发配置
# 模型选同系列最小尺寸,验证流程 + 贴近 GPU 生产环境:
# ASR = whisper tiny.en39M英文专用Whisper 同系列最小)
# 翻译 = opus-mt-en-zh~300MBNLLB-600M 需 ~2.4GB 内存2GB 开发机 OOM
# 故回退到最轻量英译中模型。翻译质量与 GPU 的 NLLB 有差异,但流程一致)
# 其余配置(存储、断句、输出格式)与 GPU 版完全一致,仅模型/device/compute_type 不同。
server:
host: 0.0.0.0
port: 8000
workers: 1
storage:
upload_dir: /data/uploads
work_dir: /data/.work
output_dir: /data/outputs
chunk_bytes: 1048576
chunk_session_ttl_seconds: 300
cache_retention_days: 7 # 任务产物保留天数,超期清理(字幕/中间音频/保留的原始视频+DB记录
cache_cleanup_interval_hours: 24 # 定时清理间隔(启动时跑一次,之后循环)
processing:
delete_original_after_extract: true
keep_audio: false
asr:
model: tiny.en # Whisper 同系列最小39M英文专用
device: cpu
compute_type: int8 # CPU 量化,最省内存
language: en
word_timestamps: true
vad_filter: true
batch_size: 8 # CPU 无 GPU 并行收益,保持小批
translation:
model: Helsinki-NLP/opus-mt-en-zh # 最轻量英译中(~300MBNLLB-600M 需 ~2.4GB2GB 机 OOM
device: cpu
src_lang: eng_Latn
tgt_lang: zho_Hans
batch_size: 8 # opus-mt 轻量batch 适中
max_length: 256
sort_by_length: true # 排序分批CPU 收益小,但无害)
segmentation:
max_words_per_line: 14
max_duration_seconds: 7.0
min_duration_seconds: 1.0
max_chars_per_line: 42
logging:
level: info # debug | info | warning | error控制台最低级别
buffer_size: 2000
docs:
enabled: true
username: admin
password: "CHANGE_ME"
realm: "audio2text docs"