Skip to content

本地 vllm 调用Qwen2-VL-7B-instruct报错 #55

@zzzcccxx

Description

@zzzcccxx

我使用vllm本地启动了 Qwen2-VL-7B-instruct 模型,并可以使用如下命令进行调用:

from GeneralAgent import Agent

agent2 = Agent('You are a helpful agent.', 
              model='Qwen2-VL-7B-Instruct', 
              token_limit=6000, 
              api_key='KKKKK',
                base_url='http://localhost:8010/v1')
agent2.user_input('介绍一下成都')

在debug时得到的输出为:

成都,简称“蓉”,是四川省会、副省级市、特大城市、国家中心城市、新一线城市,是四川省的政治、经济、文化、科教中心,西部重要的交通枢纽,国家重要的高新技术产业、金融、商贸中心。成都位于四川省中部、四川盆地西部,是中西部重要的经济中心、科技中心和金融中心。成都拥有众多历史文化遗迹,如武侯祠、杜甫草堂、青城山、都江堰等,是中国历史文化名城。同时,成都也是西南地区的交通枢纽,拥有铁路、航空、公路等多种交通方式。成都的美食文化也非常丰富,以火锅、Evaluating: agent2.user_input('介绍一下成都') did not finish after 3.00 seconds.
This may mean a number of things:
- This evaluation is really slow and this is expected.
    In this case it's possible to silence this error by raising the timeout, setting the
    PYDEVD_WARN_EVALUATION_TIMEOUT environment variable to a bigger value.

- The evaluation may need other threads running while it's running:
    In this case, it's possible to set the PYDEVD_UNBLOCK_THREADS_TIMEOUT
    environment variable so that if after a given timeout an evaluation doesn't finish,
    other threads are unblocked or you can manually resume all threads.

    Alternatively, it's also possible to skip breaking on a particular thread by setting a
    `pydev_do_not_trace = True` attribute in the related threading.Thread instance
    (if some thread should always be running and no breakpoints are expected to be hit in it).

- The evaluation is deadlocked:
    In this case you may set the PYDEVD_THREAD_DUMP_ON_WARN_EVALUATION_TIMEOUT
    environment variable to true so that a thread dump is shown along with this message and
    optionally, set the PYDEVD_INTERRUPT_THREAD_TIMEOUT to some value so that the debugger
    tries to interrupt the evaluation (if possible) when this happens.
2
串
香、担担面等为代表,深受国内外游客的喜爱。
'成都,简称“蓉”,是四川省会、副省级市、特大城市、国家中心城市、新一线城市,是四川省的政治、经济、文化、科教中心,西部重要的交通枢纽,国家重要的高新技术产业、金融、商贸中心。成都位于四川省中部、四川盆地西部,是中西部重要的经济中心、科技中心和金融中心。成都拥有众多历史文化遗迹,如武侯祠、杜甫草堂、青城山、都江堰等,是中国历史文化名城。同时,成都也是西南地区的交通枢纽,拥有铁路、航空、公路等多种交通方式。成都的美食文化也非常丰富,以火锅、串串香、担担面等为代表,深受国内外游客的喜爱。\n'

表明可以正常调用,但在运行 `gptpdf/parse.py的如下代码过程中:

    def _process_page(index: int, image_info: Tuple[str, List[str]]) -> Tuple[int, str]:
        logging.info(f'gpt parse page: {index}')
        agent = Agent(role=role_prompt, api_key=api_key, base_url=base_url, disable_python_run=True, model=model, **args)
        page_image, rect_images = image_info
        local_prompt = prompt
        if rect_images:
            local_prompt += rect_prompt + ', '.join(rect_images)
        content = agent.run([local_prompt, {'image': page_image}], display=verbose)
        return index, content

agent建立是没有问题的,但agent.run那行会报错:
LLM(Large Languate Model) error, Please check your key or base_url, or network

请问我该怎么解决呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions