Views
No views yet
BitsAndBytesConfig.
Use the included handler.py for correct inference via HuggingFace Inference Endpoints.1from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
2import torch
3
4bnb_config = BitsAndBytesConfig(
5 load_in_4bit=True,
6 bnb_4bit_quant_type="nf4",
7 bnb_4bit_compute_dtype=torch.bfloat16,
8 bnb_4bit_use_double_quant=True,
9)
10
11model = AutoModelForCausalLM.from_pretrained(
12 "Jeffcck1113/gemma-resume-shortlisting",
13 quantization_config=bnb_config,
14 device_map="auto"
15)
16tokenizer = AutoTokenizer.from_pretrained("Jeffcck1113/gemma-resume-shortlisting")