NameError: name 'init_empty_weights' is not defined

#4
by Prometheu3 - opened

NameError Traceback (most recent call last)
in <cell line: 8>()
6
7 tokenizer = AutoTokenizer.from_pretrained(model)
----> 8 pipeline = transformers.pipeline(
9 "text-generation",
10 model=model,

3 frames
/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
2606 init_contexts = [deepspeed.zero.Init(config_dict_or_path=deepspeed_config())] + init_contexts
2607 elif load_in_8bit or low_cpu_mem_usage:
-> 2608 init_contexts.append(init_empty_weights())
2609
2610 with ContextManagers(init_contexts):

NameError: name 'init_empty_weights' is not defined

you should run code in gpu env

you should run code in gpu env

Yes I solve it, but encounter another problem. Did you know how many disc space and VRAM is needed to run this model?

Prometheu3 changed discussion status to closed
Technology Innovation Institute org

Note that this error is usually linked to not having accelerate installed, you should pip install it :).

Sign up or log in to comment