shahules786
commited on
Commit
•
21edae8
1
Parent(s):
b7d3b70
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,30 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Training details
|
2 |
+
- Dataset used: Explanation style datasets from psmathur/WizardLM_Orca and Dahoas/cot_gsm8k
|
3 |
+
- Techniques: fp16 bit precision training + LoRA + DeepSpeed
|
4 |
+
- Machine: V100 (16GB) * 2
|
5 |
+
|
6 |
+
## Inference
|
7 |
+
|
8 |
+
```python
|
9 |
+
|
10 |
+
from peft import PeftModel
|
11 |
+
from huggingface_hub import hf_hub_download
|
12 |
+
from transformers import LlamaTokenizer, LlamaForCausalLM
|
13 |
+
import json
|
14 |
+
|
15 |
+
model_name = "shahules786/Redpajama-3B-orcastyle"
|
16 |
+
config = hf_hub_download(repo_id=model_name, filename="adapter_config.json", local_dir=".")
|
17 |
+
config = json.load(open("adapter_config.json"))
|
18 |
+
base_model = config["base_model_name_or_path"]
|
19 |
+
tokenizer = LlamaTokenizer.from_pretrained(model_name)
|
20 |
+
model = LlamaForCausalLM.from_pretrained(base_model)
|
21 |
+
model.resize_token_embeddings(len(self.tokenizer))
|
22 |
+
model = PeftModel.from_pretrained(model, model_name).eval()
|
23 |
+
tokenizer.padding_side = "left"
|
24 |
+
|
25 |
+
inputs = tokenizer("This is a sample run", return_tensors="pt")
|
26 |
+
model.generate(**inputs)
|
27 |
+
```
|
28 |
+
|
29 |
+
Checkout training and inference code [here](https://github.com/explodinggradients/Funtuner/tree/main/funtuner)
|
30 |
+
|