import torch from transformers import AutoModelForCausalLM checkpoint = "facebook/opt-13b" model = AutoModelForCausalLM.from_pretrained( checkpoint, device_map="auto", offload_folder="offload", offload_state_dict = True, torch_dtype=torch.float16 )