Pankaj Mathur
commited on
Commit
•
db8a0bc
1
Parent(s):
5de10f4
Update README.md
Browse files
README.md
CHANGED
@@ -6,4 +6,184 @@ license: llama2
|
|
6 |
---
|
7 |
|
8 |
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
---
|
7 |
|
8 |
|
9 |
+
# model_007
|
10 |
+
|
11 |
+
A hybrid (explain + instruct) style Llama2-70b model, Pleae check examples below for both style prompts, Here is the list of datasets used:
|
12 |
+
|
13 |
+
* Open-Platypus
|
14 |
+
* Alpaca
|
15 |
+
* WizardLM
|
16 |
+
* Dolly-V2
|
17 |
+
* Dolphin Samples (~200K)
|
18 |
+
* Orca_minis_v1
|
19 |
+
* Alpaca_orca
|
20 |
+
* WizardLM_orca
|
21 |
+
* Dolly-V2_orca
|
22 |
+
|
23 |
+
|
24 |
+
<br>
|
25 |
+
|
26 |
+
**P.S. If you're interested to collaborate, please connect with me at www.linkedin.com/in/pankajam.**
|
27 |
+
|
28 |
+
<br>
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
### quantized versions
|
33 |
+
|
34 |
+
|
35 |
+
<br>
|
36 |
+
|
37 |
+
#### license disclaimer:
|
38 |
+
|
39 |
+
This model is bound by the license & usage restrictions of the original Llama-2 model. And comes with no warranty or gurantees of any kind.
|
40 |
+
|
41 |
+
<br>
|
42 |
+
|
43 |
+
## Evaluation
|
44 |
+
|
45 |
+
We evaluated model_007 on a wide range of tasks using [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) from EleutherAI.
|
46 |
+
|
47 |
+
Here are the results on metrics used by [HuggingFaceH4 Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
48 |
+
|
49 |
+
|||||
|
50 |
+
|:------:|:--------:|:-------:|:--------:|
|
51 |
+
|**Task**|**Metric**|**Value**|**Stderr**|
|
52 |
+
|*arc_challenge*|acc_norm|0.6314|0.0141|
|
53 |
+
|*hellaswag*|acc_norm|0.8242|0.0038|
|
54 |
+
|*mmlu*|acc_norm|0.5637|0.0351|
|
55 |
+
|*truthfulqa_mc*|mc2|0.5127|0.0157|
|
56 |
+
|**Total Average**|-|**0.6329877193**||
|
57 |
+
|
58 |
+
|
59 |
+
<br>
|
60 |
+
|
61 |
+
## Example Usage
|
62 |
+
|
63 |
+
Here is the Orca prompt format
|
64 |
+
|
65 |
+
```
|
66 |
+
### System:
|
67 |
+
You are an AI assistant that follows instruction extremely well. Help as much as you can.
|
68 |
+
|
69 |
+
### User:
|
70 |
+
Tell me about Orcas.
|
71 |
+
|
72 |
+
### Assistant:
|
73 |
+
|
74 |
+
```
|
75 |
+
|
76 |
+
Below shows a code example on how to use this model
|
77 |
+
|
78 |
+
```python
|
79 |
+
import torch
|
80 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
81 |
+
|
82 |
+
tokenizer = AutoTokenizer.from_pretrained("psmathur/model_007")
|
83 |
+
model = AutoModelForCausalLM.from_pretrained(
|
84 |
+
"psmathur/model_007",
|
85 |
+
torch_dtype=torch.float16,
|
86 |
+
load_in_8bit=True,
|
87 |
+
low_cpu_mem_usage=True,
|
88 |
+
device_map="auto"
|
89 |
+
)
|
90 |
+
system_prompt = "### System:\nYou are an AI assistant that follows instruction extremely well. Help as much as you can.\n\n"
|
91 |
+
|
92 |
+
#generate text steps
|
93 |
+
instruction = "Tell me about Orcas."
|
94 |
+
prompt = f"{system_prompt}### User: {instruction}\n\n### Assistant:\n"
|
95 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
96 |
+
output = model.generate(**inputs, do_sample=True, top_p=0.95, top_k=0, max_new_tokens=4096)
|
97 |
+
|
98 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
99 |
+
|
100 |
+
```
|
101 |
+
|
102 |
+
|
103 |
+
Here is the Alpaca prompt format
|
104 |
+
|
105 |
+
```
|
106 |
+
|
107 |
+
### User:
|
108 |
+
Tell me about Alpacas.
|
109 |
+
|
110 |
+
### Assistant:
|
111 |
+
|
112 |
+
```
|
113 |
+
|
114 |
+
Below shows a code example on how to use this model
|
115 |
+
|
116 |
+
```python
|
117 |
+
import torch
|
118 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
119 |
+
|
120 |
+
tokenizer = AutoTokenizer.from_pretrained("psmathur/model_007")
|
121 |
+
model = AutoModelForCausalLM.from_pretrained(
|
122 |
+
"psmathur/model_007",
|
123 |
+
torch_dtype=torch.float16,
|
124 |
+
load_in_8bit=True,
|
125 |
+
low_cpu_mem_usage=True,
|
126 |
+
device_map="auto"
|
127 |
+
)
|
128 |
+
#generate text steps
|
129 |
+
instruction = "Tell me about Alpacas."
|
130 |
+
prompt = f"### User: {instruction}\n\n### Assistant:\n"
|
131 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
132 |
+
output = model.generate(**inputs, do_sample=True, top_p=0.95, top_k=0, max_new_tokens=4096)
|
133 |
+
|
134 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
135 |
+
|
136 |
+
```
|
137 |
+
|
138 |
+
<br>
|
139 |
+
|
140 |
+
#### Limitations & Biases:
|
141 |
+
|
142 |
+
While this model aims for accuracy, it can occasionally produce inaccurate or misleading results.
|
143 |
+
|
144 |
+
Despite diligent efforts in refining the pretraining data, there remains a possibility for the generation of inappropriate, biased, or offensive content.
|
145 |
+
|
146 |
+
Exercise caution and cross-check information when necessary.
|
147 |
+
|
148 |
+
|
149 |
+
<br>
|
150 |
+
|
151 |
+
### Citiation:
|
152 |
+
|
153 |
+
Please kindly cite using the following BibTeX:
|
154 |
+
|
155 |
+
```
|
156 |
+
@misc{model_007,
|
157 |
+
author = {Pankaj Mathur},
|
158 |
+
title = {model_007: A hybrid (explain + instruct) style Llama2-70b model},
|
159 |
+
year = {2023},
|
160 |
+
publisher = {HuggingFace},
|
161 |
+
journal = {HuggingFace repository},
|
162 |
+
howpublished = {\url{https://https://huggingface.co/psmathur/model_007},
|
163 |
+
}
|
164 |
+
```
|
165 |
+
|
166 |
+
```
|
167 |
+
@misc{mukherjee2023orca,
|
168 |
+
title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
|
169 |
+
author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
|
170 |
+
year={2023},
|
171 |
+
eprint={2306.02707},
|
172 |
+
archivePrefix={arXiv},
|
173 |
+
primaryClass={cs.CL}
|
174 |
+
}
|
175 |
+
```
|
176 |
+
|
177 |
+
```
|
178 |
+
@software{touvron2023llama2,
|
179 |
+
title={Llama 2: Open Foundation and Fine-Tuned Chat Models},
|
180 |
+
author={Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava,
|
181 |
+
Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller,
|
182 |
+
Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez Madian Khabsa, Isabel Kloumann,
|
183 |
+
Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee, Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov,
|
184 |
+
Pushkar Mishra, Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith,
|
185 |
+
Ranjan Subramanian, Xiaoqing Ellen Tan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu , Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan,
|
186 |
+
Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic, Sergey Edunov, Thomas Scialom},
|
187 |
+
year={2023}
|
188 |
+
}
|
189 |
+
```
|