Qwen3 ASR 使用说明
Qwen3-ASR-1.7B 是 Qwen 团队推出的 1.7B 参数自动语音识别(ASR)模型。它支持中英文语音、中文方言、多语种语音及歌声转录,并提供长音频和流式推理能力。
2.快速上手
Section titled “2.快速上手”首先我们进入 https://console.suanli.cn/serverless/create 创建任务,
选择 Qwen3 ASR 预制镜像后发布任务
集群有镜像缓存时 1~2 分钟 任务即可启动成功。
此时暴露的链接即为服务地址。
3.api 接口
Section titled “3.api 接口”方法 | 路径 | 说明 |
GET |
| 健康检查 |
GET |
| 支持的语种列表 |
POST |
| JSON 批量接口, |
POST |
| OpenAI 风格文件上传(multipart) |
curl -X POST <服务地址>/transcribe \ -H "Content-Type: application/json" \ -d '{"audio": ["https://example.com/a.wav"], "language": ["Chinese"], "return_time_stamps": true}'
curl -F "file=@test.wav" -F "return_time_stamps=true" \ <服务地址>/v1/audio/transcriptions返回:
{"results": [{"language": "Chinese", "text": "……", "time_stamps": [{"text": "甚", "start_time": 0.4, "end_time": 0.72}]}]}GET /health
Section titled “GET /health”健康检查。模型未加载完成时仍可访问,status 为 loading。
响应 200
{“status”: “ok”, “model”: “/models/Qwen3-ASR-1.7B”, “backend”: “vllm”}
GET /v1/languages
Section titled “GET /v1/languages”返回模型支持的语种列表(规范英文名称)。
响应 200
{"languages": ["Chinese", "English", "Cantonese", "Arabic", "German", "..."]}
响应 503:模型未加载完成。
共 30 种语言:Chinese, English, Cantonese, Arabic, German, French,
Spanish, Portuguese, Indonesian, Italian, Korean, Russian, Thai,
Vietnamese, Japanese, Turkish, Hindi, Malay, Dutch, Swedish, Danish,
Finnish, Polish, Czech, Filipino, Persian, Greek, Romanian, Hungarian,
Macedonian。
POST /transcribe
Section titled “POST /transcribe”批量转写接口,JSON 请求体。audio 中每一项可为:
- http(s) URL(服务端下载解码)
- base64 字符串(裸 base64 或
data:audio/...;base64,...URI)
格式支持 wav/flac/ogg(soundfile 解码);本地路径另经 librosa 解码,
mp3/m4a/aac 等依赖容器内 ffmpeg。所有音频统一重采样为 16kHz 单声道。
language 取值规则:
- 使用规范英文名称,大小写不敏感(
"chinese"→"Chinese"),不接受zh/en等代码 - 不在支持列表中 →
400 - 强制语言后模型只输出纯文本,
language字段即所传值
响应 200
Section titled “响应 200”{ "results": [ { "language": "Chinese", "text": "甚至出现交易几乎停滞的情况。", "time_stamps": [ {"text": "甚", "start_time": 0.4, "end_time": 0.72} ] } ]}results[] 与 audio[] 一一对应:
内部行为:
- 音频超过 1200s 自动切片分别转写再拼接文本;开启时间戳时按 180s 切片
- 不足 0.5s 的片段尾部补零
- 时间戳为对原始音频的绝对时间(切片偏移已补偿)
POST /v1/audio/transcriptions
Section titled “POST /v1/audio/transcriptions”OpenAI 风格文件上传接口(multipart/form-data),单文件。
响应 200
Section titled “响应 200”返回单个结果对象(结构同 /transcribe 的 results[] 元素):
{ "language": "Chinese", "text": "甚至出现交易几乎停滞的情况。", "time_stamps": [{"text": "甚", "start_time": 0.4, "end_time": 0.72}]}错误码同 /transcribe(400 / 503 / 500)。
vllm serve
Section titled “vllm serve”如果需要 openai api 兼容服务可使用 模板
{"task_id":3141517,"task_type":"Deployment","task_name":"d202609111701-vllm-qwen3-asr20","namespace":"yhjl2g4g1mssdzraskzrxgskonwzosto-452","resources":[{"resource":{"device_name":"4090","region":"fjsq","gpu_name":"4090","gpu_count":1,"gpu_memory":24560,"memory":64512,"cpu_cores":18},"region_name":"福建四区","mark":"ha8GDGEAORN3a9Hhu7X+W/lveP9CW2eBkI+oB/QJLRcavuLLd61ujKeY+vGeUDxhiEAhWFnkamiQ9giiXEHkQukK18NVCWRqY+9/twUUqM5DAzL34Rac3yJhW9e32lRJWaQd/yewVgjBjhu1b3C529w4RznmE/pVrBbLs35TaxA8/XkigLKC","weight":null}],"scheduler_strategy":null,"scheduler_resources":null,"status":"Paused","points":1,"runing_points":0,"billing_points":0,"billing_value":204771,"forecast_value":0,"services":[{"service_id":3145316,"service_name":"container-01","service_image":"harbor.suanleme.cn/public-hub/laiaqwq/vllm-qwen3-asr:20260911-rc1","remote_ports":[{"url":"https://deployment-452-dhi-8000.550w.link","service_port":8000}],"health_checks":{"liveness_probe":{"switch":false,"probe_type":"httpGet","path":"/live","port":80,"initial_delay_seconds":0,"period_seconds":10,"timeout_seconds":1,"failure_threshold":3},"startup_probe":{"switch":false,"probe_type":"httpGet","path":"/health","port":80,"initial_delay_seconds":0,"period_seconds":10,"timeout_seconds":1,"failure_threshold":3},"readiness_probe":{"switch":false,"probe_type":"httpGet","path":"/ready","port":80,"initial_delay_seconds":0,"period_seconds":10,"timeout_seconds":1,"failure_threshold":3}},"storage_config":[],"share_storage_config":[],"nas_storage_config":[],"share_mem_config":[{"target_dir":"/dev/shm","volume_name":"mem-default","read_only":null,"sub_path_expr":null}],"share_disk_config":[],"env":[],"start_script":{"command":[],"args":[]},"repository_account":null,"is_update_repository":null,"resource_weight":{"cpu_weight":1,"mem_weight":1,"gpu_weight":1},"registered_ports":null,"restart_policy":null}],"init_services":null,"deployment_yaml":null,"development_support":null,"deployment_name":"deployment-452-2l2x9dhi","task_tags":null,"dynamic_pod_strategy":null,"load_balance":null,"task_schedules":null,"task_qos":null,"share_disk_volumes":[],"share_mem_volumes":[{"name":"mem-default","size_limit":4196}],"scheduling_template":null,"termination_grace_period_seconds":null,"user_info":{"nickname":"name","tenant_nickname":null}}