Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- id
|
4 |
+
pipeline_tag: conversational
|
5 |
+
---
|
6 |
+
|
7 |
+
## How to Use
|
8 |
+
|
9 |
+
'python
|
10 |
+
import torch
|
11 |
+
import bitsandbytes as bnb
|
12 |
+
from transformers import LlamaTokenizer, LlamaForCausalLM, GenerationConfig
|
13 |
+
from peft import PeftModel, PeftConfig, prepare_model_for_int8_training, LoraConfig, get_peft_model
|
14 |
+
|
15 |
+
peft_model_id = "firqaaa/indo-Alpaca-LoRA-7b"
|
16 |
+
|
17 |
+
tokenizer = LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf")
|
18 |
+
model = LlamaForCausalLM.from_pretrained("decapoda-research/llama-7b-hf",
|
19 |
+
load_in_8bit=True,
|
20 |
+
device_map="auto")
|
21 |
+
# Load the LoRA model
|
22 |
+
model = PeftModel.from_pretrained(model, peft_model_id)'
|