Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG/Help] <title>运行web_demo.py报错 #616

Open
1 task done
gotcha001x opened this issue Nov 3, 2023 · 2 comments
Open
1 task done

[BUG/Help] <title>运行web_demo.py报错 #616

gotcha001x opened this issue Nov 3, 2023 · 2 comments

Comments

@gotcha001x
Copy link

gotcha001x commented Nov 3, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

部署环境:阿里云ECS

CPU&内存:12核(vCPU) 92 GiB

操作系统:Anolis OS 8.6 RHCK 64位

GPU: NVIDIA V100
只做了路径修改:
tokenizer = AutoTokenizer.from_pretrained("/root/ChatGLM2-6B/chatglm2-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("/root/ChatGLM2-6B/chatglm2-6b", trust_remote_code=True).cuda()

运行web_demo.py报错
Loading checkpoint shards: 100%|███████████████████████████████████████████████| 7/7 [00:07<00:00, 1.10s/it]
Traceback (most recent call last):
File "web_demo.py", line 89, in
user_input = gr.Textbox(show_label=False, placeholder="Input...", lines=10).style(
AttributeError: 'Textbox' object has no attribute 'style'

运行其他一切正常

Expected Behavior

No response

Steps To Reproduce

yum install python38 -y
git clone https://github.com/THUDM/ChatGLM2-6B
pip3 install -r requirements.txt
git clone https://huggingface.co/THUDM/chatglm2-6b
vim web_demo.py
python3 web_demo.py

Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :

Anything else?

No response

@huzixuan1
Copy link

I think you should the below code:
Duplicate of #
user_input = gr.Textbox(show_label=False, placeholder="Input...", lines=10).style( container=False)
instead
user_input = gr.Textbox(show_label=False, placeholder="Input...", lines=10)

@NightWalker4396
Copy link

AttributeError: 'Textbox' object has no attribute 'style'. Did you mean: 'scale'
当启动web_demo.py出现上面这个错误的时候,其实是gradio的问题,版本太高了。个人猜测可能是pip默认安装最新版本,新版本中api有变化,所以识别不了。

所以只需要卸载当前版本,安装旧版就好了哈。

pip uninstall gradio
pip install gradio==3.39.0
————————————————
版权声明:本文为CSDN博主「WongVin」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u013292152/article/details/134266634

Saigut added a commit to Saigut/ChatGLM2-6B that referenced this issue Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants