modelscope / modelscope/ms-swift

用vllm部署部署qwen2.5-omni时,输入视频url可以正常输出,但输入本地路径server端print满屏乱码

Open
#5,663 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
15.7k
Forks
1.7k
Avg merge
1d 16h
Merged PRs (30d)
136

Description

server端代码:

FPS_MAX_FRAMES=180
USE_AUDIO_IN_VIDEO=1
VIDEO_MAX_PIXELS=150528
FPS=1.0
ENABLE_AUDIO_OUTPUT=0
CUDA_VISIBLE_DEVICES=6,7 swift deploy
--model Qwen/Qwen2.5-Omni-7B
--vllm_gpu_memory_utilization 0.6
--infer_backend vllm
--host 127.0.0.1
--port 8000
--served_model_name Qwen2.5-Omni-7B

client端代码:

import os

os.environ['VIDEO_MAX_PIXELS'] = '150528'
os.environ['USE_AUDIO_IN_VIDEO'] = '1'
os.environ['FPS'] = '1'
os.environ['ENABLE_AUDIO_OUTPUT'] = '0'

from swift.llm import InferRequest, InferClient, RequestConfig
from swift.plugin import InferStats

engine = InferClient(host='127.0.0.1', port=8000)
print(f'models: {engine.models}')
metric = InferStats()
request_config = RequestConfig(max_tokens=512, temperature=0)

这里使用了3个infer_request来展示batch推理

支持传入本地路径、base64和url

infer_requests = [
InferRequest(messages=[{'role': 'user', 'content': ' 详细描述该视频'}],
videos=['/data/wujiahui/143871438447.mp4']),
]

resp_list = engine.infer(infer_requests, request_config, metrics=[metric])
print(f'response0: {resp_list[0].choices[0].message.content}')
print(metric.compute())
metric.reset()

server端输出:

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the shown swift deploy command and the InferClient request using the local MP4 path, then compare it with the URL case. Start at the swift deploy server entry point and the InferRequest video-input handling. Done means local-video inference returns normally without filling the server output with garbled text.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.