Skip to content

Issue when trying to run instruction_tuning.ipynb #1

@kannangce

Description

@kannangce

I'm trying to run instruction_tuning.ipynb with a custom csv. Though I have't gotten to the part of custom data yet, I'm getting issue in the below code,

model = AutoModelForCausalLM.from_pretrained(
        BASE_MODEL,
        device_map="auto",
        load_in_8bit=True,
        trust_remote_code=True,
    )

The error is,

ImportError Traceback (most recent call last)
in <cell line: 1>()
----> 1 model = AutoModelForCausalLM.from_pretrained(
2 BASE_MODEL,
3 device_map="auto",
4 load_in_8bit=True,
5 trust_remote_code=True,

1 frames
/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py in from_pretrained(cls, pretrained_model_name_or_path, config, cache_dir, ignore_mismatched_sizes, force_download, local_files_only, token, revision, use_safetensors, *model_args, **kwargs)
2399 if load_in_8bit or load_in_4bit:
2400 if not (is_accelerate_available() and is_bitsandbytes_available()):
-> 2401 raise ImportError(
2402 "Using load_in_8bit=True requires Accelerate: pip install accelerate and the latest version of"
2403 " bitsandbytes pip install -i https://test.pypi.org/simple/ bitsandbytes or"

ImportError: Using load_in_8bit=True requires Accelerate: pip install accelerate and the latest version of bitsandbytes pip install -i https://test.pypi.org/simple/ bitsandbytes or pip install bitsandbytes`


NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.

I have executed the below pip installs and restart the collab.

!pip install  --upgrade transformers
!pip install peft
!pip install datasets
!pip install  --upgrade accelerate
!pip install --upgrade bitsandbytes

Is it known issue? If so any idea on getting it fixed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions