#540·CogVLM

搭建 web 端示例报错

作者: RoninBang创建于 2024年12月12日更新于 2026年5月9日

I used the following command in basic_demo to build a web interface: Python web_demo.py --from_pretrained ../cogagent-chat-hf --version chat --bf16 The cogagent-chat-hf directory is the model I downloaded from huggingface. However, it reported the following error: (visual-LLM) root@ubuntu:~/visual-LLM/CogVLM/basic_demo# Python web_demo.py --from_pretrained ../cogagent-chat-hf --version chat --bf16 [2024-12-12 11:42:00,560] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect) /root/anaconda3/envs/visual-LLM/lib/python3.10/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning) Please build and install the Nvidia apex package with the option '--cuda_ext' according to https://GitHub.com/NVIDIA/apex#from-source . ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ /root/visual-LLM/CogVLM/basic_demo/web_demo.py:234 in <module> ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /root/visual-LLM/CogVLM/basic_demo/web_demo.py:165 in main ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /root/visual-LLM/CogVLM/basic_demo/web_demo.py:65 in load_model