Skip to content

VLLM加速推理与直接加载推理效果不一致 #188

Description

@Sunnycl

Description

直接使用Qwen3ASRModel.from_pretrained加载并识别时为正确内容,但是通过qwen-asr-serve Qwen/Qwen3-ASR-1.7B --gpu-memory-utilization 0.8 --host 0.0.0.0 --port 8000部署的服务推理出现了重复的 “嗯”,数百个

Reproduction

直接推理:
from qwen_asr import Qwen3ASRModel

model = Qwen3ASRModel.from_pretrained(
"Qwen/Qwen3-ASR-1.7B",
dtype=torch.bfloat16,
device_map="cuda:0",
# attn_implementation="flash_attention_2",
max_inference_batch_size=32, # Batch size limit for inference. -1 means unlimited. Smaller values can help avoid OOM.
max_new_tokens=256, # Maximum number of tokens to generate. Set a larger value for long audio input.
)
results = model.transcribe(
audio=audio_url,
language=None, # set "English" to force the language
)
return results[0].text

加速服务:
qwen-asr-serve Qwen3-ASR-1.7B --gpu-memory-utilization 0.8 --host 0.0.0.0 --port 8000
client = OpenAI(base_url=“http://localhost:8000/v1”, api_key="EMPTY")
response = client.chat.completions.create(
model=ASR_MODEL,
messages=[
{
"role": "user",
"content": [{"type": "audio_url", "audio_url": {"url": audio_url}}],
}
],
)
return clean_asr_text(response.choices[0].message.content)

Logs

Environment Information

GPU:H20 96G
CUDA: 13.0
ubuntu 22.4

Known Issue

  • The issue hasn't been already addressed in Documentation, Issues, and Discussions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions