Skip to content

llamafactory-cliapi 推理Qwen3-VL-32B-Instruct报错:openai.BadRequestError: Error code: 400 - {'detail': 'Invalid or inaccessible file path.'} #9581

@fuqiang-benz

Description

@fuqiang-benz

Reminder

  • I have read the above rules and searched the existing issues.

System Info

环境:使用llamafactory:npu-a2 docker镜像启动
版本:
llamafactory :0.9.4.dev0
torch : 2.7.1+cpu
torch_npu : 2.7.1
openai : 1.5.0

启动命令:
llamafactory-cli api examples/inference/qwen3_vl.yaml

qwen3_vl.yaml:
model_name_or_path: /home/LLM/llm_models/Qwen3-VL-32B-Instruct
template: qwen3_vl

请求脚本:
def main(): client = OpenAI( api_key="{}".format(os.getenv("API_KEY", "0")), base_url="http://183.242.165.15:{}/v1".format(os.getenv("API_PORT", 11245)), ) messages = [] messages.append( { "role": "user", "content": [ {"type": "text", "text": "Output the color and number of each box."}, { "type": "image_url", "image_url": {"url": "/home/LLM/llm_models/qwen2_5_VL_32B_images/1.png"}, }, ], } ) result = client.chat.completions.create(messages=messages, model="test") messages.append(result.choices[0].message) print("Round 1:", result.choices[0].message.content)

发现奇怪现象:
image_url 传入链接时可以正常识别
image_url 传入本地路径报错:openai.BadRequestError: Error code: 400 - {'detail': 'Invalid or inaccessible file path.'}

Reproduction

Put your message here.

Others

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpendingThis problem is yet to be addressed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions