Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,36 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- daven3/geosignal
|
5 |
+
language:
|
6 |
+
- en
|
7 |
---
|
8 |
+
|
9 |
+
# Adapter Model in K2
|
10 |
+
|
11 |
+
## Quick Start
|
12 |
+
|
13 |
+
**After deploying the model [k2_fp_delta](https://huggingface.co/daven3/k2_fp_delta), we need to use the `PEFT` API from `transformers` to load the entire K2!**
|
14 |
+
|
15 |
+
```python
|
16 |
+
base_model = /path/to/geollama
|
17 |
+
lora_weights = /path/to/adapter/model
|
18 |
+
tokenizer = LlamaTokenizer.from_pretrained(base_model)
|
19 |
+
model = LlamaForCausalLM.from_pretrained(
|
20 |
+
base_model,
|
21 |
+
load_in_8bit=load_8bit,
|
22 |
+
device_map=device_map
|
23 |
+
torch_dtype=torch.float16
|
24 |
+
)
|
25 |
+
model = PeftModel.from_pretrained(
|
26 |
+
model,
|
27 |
+
lora_weights,
|
28 |
+
torch_dtype=torch.float16,
|
29 |
+
device_map=device_map,
|
30 |
+
)
|
31 |
+
model.config.pad_token_id = tokenizer.pad_token_id = 0
|
32 |
+
model.config.bos_token_id = 1
|
33 |
+
model.config.eos_token_id = 2
|
34 |
+
```
|
35 |
+
|
36 |
+
|