Update README.md
Browse files
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:
|