Hello All,
I am trying to load meta/opt6.7B in Kaggle with dual T4 GPU. The code is simple and I could run that in colab. But I can’t make it work in Kaggle. What am I missing?
Here is the code -
!pip install bitsandbytes datasets accelerate loralib
!pip install transformers peft
import os
# os.environ["CUDA_VISIBLE_DEVICES"]="0"
import torch
import torch.nn as nn
import bitsandbytes as bnb
from transformers import AutoTokenizer, AutoConfig, AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained(
"facebook/opt-6.7b",
load_in_8bit=True,
device_map='auto',
)
tokenizer = AutoTokenizer.from_pretrained("facebook/opt-6.7b")
And here is the stack trace.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_23/3843057406.py in <module>
9 "facebook/opt-6.7b",
10 load_in_8bit=True,
---> 11 device_map='auto',
12 )
13
/opt/conda/lib/python3.7/site-packages/transformers/models/auto/auto_factory.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
463 model_class = _get_model_class(config, cls._model_mapping)
464 return model_class.from_pretrained(
--> 465 pretrained_model_name_or_path, *model_args, config=config, **hub_kwargs, **kwargs
466 )
467 raise ValueError(
/opt/conda/lib/python3.7/site-packages/transformers/modeling_utils.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
2527 # Dispatch model with hooks on all devices if necessary
2528 if device_map is not None:
-> 2529 dispatch_model(model, device_map=device_map, offload_dir=offload_folder, offload_index=offload_index)
2530
2531 if output_loading_info:
TypeError: dispatch_model() got an unexpected keyword argument 'offload_index'
Any idea what can be done? I am a bit clueless. Any help is much appreciated.