Skip to content

swift deploy的服务,很容易提前触发停止符 #4900

Open
@qiuchen001

Description

@qiuchen001

现象:

{'response': '```json', 'infer_request': {'messages': [{'role': 'system', 'content': '\n\n## 任务:\n依据用户输入的内容标记相应的意图,并以指定的JSON格式返回结构化结果。\n\n### 标签库\n标签库包含以下标签:\n- 急刹车\n- 急加速\n\n### 输出格式\n对于每个输入,您需要返回一个 **JSON数组**,其中可能包含一个或两个对象。每个对象必须包含以下两个键:\n- type:表示搜索类型,值为 "tag""text"。\n - tag 表示基于标签库的搜索。\n - text 表示基于文本内容的向量化匹配搜索。\n- list:表示对应的搜索内容。\n - 如果 type"tag",则 list是一个字符串数组,包含要搜索的标签。\n - 如果type"text",则 list 是一个字符串数组,包含要检索的文本内容。\n\n\n\n\n\n\n'}, {'role': 'user', 'content': '前方车辆突然变道'}], 'images': [], 'audios': [], 'videos': [], 'tools': None, 'objects': {}}, 'generation_config': SamplingParams(n=1, presence_penalty=0.0, frequency_penalty=0.0, repetition_penalty=1.05, temperature=0.5, top_p=1.0, top_k=50, min_p=0.0, seed=None, stop=['<|endoftext|>', '<|im_end|>'], stop_token_ids=[], bad_words=[], include_stop_str_in_output=False, ignore_eos=False, max_tokens=1500, min_tokens=0, logprobs=None, prompt_logprobs=None, skip_special_tokens=True, spaces_between_special_tokens=True, truncate_prompt_tokens=None, guided_decoding=None)}

现象解释:

infer_request是向服务提供的信息,response是返回的内容。从提示词设计来看,模型不应该返回:'```json。

部署脚本:

swift deploy \ --model /path/to/Qwen2.5-VL-72B-Instruct \ --infer_backend vllm \ --gpu_memory_utilization 0.98 \ --tensor-parallel-size 2 \ --max_model_len 24576 \ --max_new_tokens 8192 \ --limit_mm_per_prompt '{"image": 100, "video": 10}' \ --max_num_seqs 512 \ --port 8000 \ --served_model_name Qwen2.5-VL-72B-Instruct

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