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

文档提供的colab链接不能运行 #51

Closed
Linnest2020 opened this issue Apr 9, 2023 · 1 comment
Closed

文档提供的colab链接不能运行 #51

Linnest2020 opened this issue Apr 9, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Linnest2020
Copy link

本人使用文档提供的colab链接, 发现不能运行在colab上

本人未有修改过提供的脚本, 也未有改变脚本参数和命令参数,然后其他参数、数据都和你们一致。

运行了如下三个命令

!git clone https://github.com/Facico/Chinese-Vicuna
!pip install -r ./Chinese-Vicuna/requirements.txt
!python ./Chinese-Vicuna/generate.py --model_path decapoda-research/llama-7b-hf --lora_path Facico/Chinese-Vicuna-lora-7b-3epoch-belle-and-guanaco --use_local 0

然后在第三行命令运行发生错误, 产生如下报错信息, 并停止运行

Downloading shards: 100% 33/33 [01:47<00:00,  3.27s/it]
Loading checkpoint shards: 100% 33/33 [01:23<00:00,  2.52s/it]
Downloading (…)neration_config.json: 100% 124/124 [00:00<00:00, 19.8kB/s]
Downloading (…)/adapter_config.json: 100% 370/370 [00:00<00:00, 123kB/s]
Downloading adapter_model.bin: 100% 16.8M/16.8M [00:00<00:00, 79.3MB/s]
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /content/./Chinese-Vicuna/generate.py:110 in <module>                        │
│                                                                              │
│   107 if not LOAD_8BIT:                                                      │
│   108 │   model.half()  # seems to fix bugs for some users.                  │
│   109                                                                        │
│ ❱ 110 model.eval()                                                           │
│   111 if torch.__version__ >= "2" and sys.platform != "win32":               │
│   112 │   model = torch.compile(model)                                       │
│   113                                                                        │
╰──────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'NoneType' object has no attribute 'eval'

使用!pip list | grep torch得出的结果如下

torch                         2.0.0+cu118
torchaudio                    2.0.1+cu118
torchdata                     0.6.0
torchsummary                  1.5.1
torchtext                     0.15.1
torchvision                   0.15.1+cu118
@Linnest2020 Linnest2020 changed the title 文档提供的[colab链接](https://colab.research.google.com/drive/1OLCJ-ZHogm5O3RdyUDY83YfgnCXdHNXp?usp=sharing)不能运行 文档提供的colab链接不能运行 Apr 9, 2023
@Facico
Copy link
Owner

Facico commented Apr 9, 2023

@Linnest2020 感谢提醒。因为我们安装peft是直接从github仓库拉去的,他们的最新版本的set_peft_model_state_dict不返回model了。

可以在安装完依赖之后加上如下命令,从特定的某个git commit hash拉取。
同时我已经将requirement list更新了,也可以尝试重新加载一遍colab

!pip uninstall peft
!pip install git+https://github.com/huggingface/peft@e536616888d51b453ed354a6f1e243fecb02ea08

我们后续会将代码和他们最新版的接口对接并兼容旧版本。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants