I use the following configuration of huggingface model: quantization_config = BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16, ) tokenizer = AutoTokenizer.from_pretrained( "google/gemma-2-9b-it", token=access_token ) model = AutoModelForCausalLM.from_pretrained( "google/gemma-2-9b-it", quantization_config=quantization_config, torch_dtype=torch.bfloat16, token=access_token, ) Such config is...
Originally asked by Andrey on Stack Exchange (stackoverflow) (CC BY-SA 4.0).