My pipeline exits after it output the " Loading checkpoint shards : 0%"

Hi, everyone. I am new to huggingface and my code is as follows:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer      
from transformers import pipeline
pipe = pipeline("text-generation", model="microsoft/phi-2",force_download=True, resume_download=False)
print(pipe("what color is apple?"))

It only outputs
Loading checkpoint shards: 0%| | 0/2 [00:00<?, ?it/s]
then exits. It seems the model has been successfully downloaded based on previous runs (which are not shown here), but it still failed on working properly. What does this output mean? I’ll appreciate any attention and help. Thanks.

1 Like

Turned out I downloaded the wrong checkpoint data. Something might go wrong with the internet back then.

你好,请问什么叫下载了错误的检查点数据呢?我也遇到了同样的问题

你在哪下的数据,重下一遍看看。有时候检查点的数据可能会出错,原因可能是检查点的参数名和库里的类参数名不对上,也就是库更新了,但模型数据没更新,两者无法完成值传递。你试着把两个都拉到最新,pip install transformers --upgrade 再下载最新的检查点。

也可能是内存不够参数用。