SaborDay commited on
Commit
0c8d56b
1 Parent(s): 69177d6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -0
README.md CHANGED
@@ -85,6 +85,19 @@ Usage:
85
  text = tokenizer.batch_decode(outputs,skip_special_tokens=True)[0]
86
  print(text)
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
 
90
  Example:
 
85
  text = tokenizer.batch_decode(outputs,skip_special_tokens=True)[0]
86
  print(text)
87
 
88
+ Usage (with quantization):
89
+
90
+ bnb_config = BitsAndBytesConfig(load_in_4bit=True,
91
+ bnb_4bit_quant_type='nf4',
92
+ bnb_4bit_compute_dtype=torch.bfloat16,
93
+ bnb_4bit_use_double_quant=True)
94
+ [...]
95
+
96
+ model = AutoModelForCausalLM.from_pretrained(..., quantization_config=bnb_config)
97
+
98
+ [...]
99
+
100
+ fine_tuned_model = PeftModel.from_pretrained(... , quantization_config=bnb_config)
101
 
102
 
103
  Example: