1 问题描述
在本地部署chatglm2-6B的时候可能出现,运行web_demo.py,出现如下错误:
(chatglm) [root@localhost ChatGLM2-6B]# python web_demo.py
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:37<00:00, 5.31s/it]
Traceback (most recent call last):
File "/opt/ChatGLM2-6B/web_demo.py", line 89, in <module>
user_input = gr.Textbox(show_label=False, placeholder="Input...", lines=10).style(
AttributeError: 'Textbox' object has no attribute 'style'
2 问题分析
使用pip list查看本地已经安装的工具包版本,如下所示:
(chatglm) [root@localhost ChatGLM2-6B]# pip list
Package Version
------------------------- ------------
accelerate 0.25.0
aiofiles 23.2.1
altair 5.2.0
annotated-types 0.6.0
anyio 4.2.0
attrs 23.2.0
blinker 1.7.0
cachetools 5.3.2
certifi 2023.11.17
charset-normalizer 3.3.2
click 8.1.7
colorama 0.4.6
contourpy 1.2.0
cpm-kernels 1.0.11
cycler 0.12.1
exceptiongroup 1.2.0
fastapi 0.108.0
ffmpeg-python 0.2.0
ffmpy 0.3.1
filelock 3.13.1
fonttools 4.47.0
fsspec 2023.12.2
gitdb 4.0.11
GitPython 3.1.40
gradio 4.12.0
gradio_client 0.8.0
h11 0.14.0
httpcore 1.0.2
httpx 0.26.0
huggingface-hub