avanish07 commited on
Commit
e293bd8
1 Parent(s): 9de8db6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -25,7 +25,8 @@ from IPython.display import Markdown, display
25
  peft_model_id = "./"
26
  config = PeftConfig.from_pretrained(peft_model_id)
27
 
28
- bnb_config = BitsAndBytesConfig(
 
29
  load_in_8bit_fp32_cpu_offload=True,
30
  bnb_8bit_use_fp16=False,
31
  load_in_4bit=True,
@@ -45,7 +46,7 @@ device_map = {
45
  model = AutoModelForCausalLM.from_pretrained(
46
  config.base_model_name_or_path,
47
  return_dict=True,
48
- quantization_config=bnb_config,
49
  device_map=device_map,
50
  trust_remote_code=True,
51
  )
 
25
  peft_model_id = "./"
26
  config = PeftConfig.from_pretrained(peft_model_id)
27
 
28
+ quantization_config = BitsAndBytesConfig(
29
+ llm_int8_enable_fp32_cpu_offload=True, # Enable offloading to CPU in float32 precision
30
  load_in_8bit_fp32_cpu_offload=True,
31
  bnb_8bit_use_fp16=False,
32
  load_in_4bit=True,
 
46
  model = AutoModelForCausalLM.from_pretrained(
47
  config.base_model_name_or_path,
48
  return_dict=True,
49
+ quantization_config=quantization_config,
50
  device_map=device_map,
51
  trust_remote_code=True,
52
  )