pankajmathur commited on
Commit
6ec0b1d
·
1 Parent(s): 49f4547

Update README.md

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