WisdomShell / codeshell

A series of code large language models developed by PKU-KCL
http://se.pku.edu.cn/kcl
Other
1.62k stars 119 forks source link

[Errno 2] No such file or directory: 'WisdomShell/CodeShell-7B-Chat-int4/pytorch_model.bin' #16

Open tt1998215 opened 11 months ago

tt1998215 commented 11 months ago

我修改了 webdemo.py DEFAULT_CKPT_PATH = 'WisdomShell/CodeShell-7B-Chat-int4'

然后运行报错

    return model_class.from_pretrained(
  File "/root/.cache/huggingface/modules/transformers_modules/WisdomShell/CodeShell-7B-Chat-int4/10629399134587be6ea6d65f54c52c22a0c23c29/modeling_codeshell.py", line 1058, in from_pretrained
    state_dict = torch.load(os.path.join(pretrained_model_name_or_path, 'pytorch_model.bin'), map_location="cpu")
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 986, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 435, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 416, in __init__
    super().__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'WisdomShell/CodeShell-7B-Chat-int4/pytorch_model.bin'

我把hugginface上的模型 下载了 去缓存 /root/.cache/huggingface/modules/transformers_modules/WisdomShell/CodeShell-7B-Chat-int4 /root/codeshell/demos/WisdomShell/CodeShell-7B-Chat-int4

在这两地方 都放了 还是找不到 到底应该把模型放在哪呢

tt1998215 commented 11 months ago

试了下DEFAULT_CKPT_PATH = 'WisdomShell/CodeShell-7B-Chat' 是没问题的

ruixie commented 11 months ago

默认地址与您本地的配置有关,如果是手动下载的模型,建议将DEFAULT_CKPT_PATH改为绝对地址

tt1998215 commented 11 months ago

默认地址与您本地的配置有关,如果是手动下载的模型,建议将DEFAULT_CKPT_PATH改为绝对地址

Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. A new version of the following files was downloaded from https://huggingface.co/WisdomShell/CodeShell-7B-Chat-int4:

好像是在服务器上找到了两个版本 然后 也不知道 该输入个啥 最后啥也没下载