Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,101 @@
|
|
1 |
---
|
2 |
license: llama2
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: llama2
|
3 |
---
|
4 |
+
|
5 |
+
# Dromedary-2 (verbose, v1) Model Card
|
6 |
+
|
7 |
+
## Model details
|
8 |
+
|
9 |
+
<div style="display: flex; justify-content: center; align-items: center;">
|
10 |
+
<img src="https://raw.githubusercontent.com/IBM/SALMON/main/assets/images/salmon_logo_with_text.jpeg" alt="SALMON Logo" style="height: 256px; margin-right: 10px;"/>
|
11 |
+
<img src="https://raw.githubusercontent.com/IBM/Dromedary/main/assets/images/dromedary_logo.svg" alt="Dromedary Logo" style="height: 256px;"/>
|
12 |
+
</div>
|
13 |
+
|
14 |
+
**Model type:**
|
15 |
+
Dromedary-2 is an open-source self-aligned language model trained in minimal human supervision with the SALMON (Self-Alignment with Principle-Following Reward Models) technique.
|
16 |
+
The base language model is LLaMA-70b, based on the transformer architecture.
|
17 |
+
|
18 |
+
**NOTE: *Dromedary-2* is trained with [QLoRA](https://github.com/artidoro/qlora) and the bfloat16 data type.** While it is [possible](https://gist.github.com/ChrisHayduk/1a53463331f52dca205e55982baf9930) to merge the QLoRA weights with the quantized model and thus enable inference with libraries such as [TGI](https://github.com/huggingface/text-generation-inference) and [vLLM](https://github.com/vllm-project/vllm), we found the merged weights can lead to degenerated performance. Therefore, we recommend directly loading the QLoRA weights with the [PEFT-LoRA](https://github.com/huggingface/peft) framework.
|
19 |
+
|
20 |
+
Please check the [inference section](https://github.com/IBM/SALMON/inference) of our repo for the complete inference code.
|
21 |
+
|
22 |
+
```python
|
23 |
+
system_prompt = (
|
24 |
+
"# Dromedary\n\n## System Overview\n\n"
|
25 |
+
"Consider an AI assistant whose codename is Dromedary, developed by the Self-Align team. "
|
26 |
+
"Dromedary is trained on data up until Sept-2022, and it endeavors to be a helpful, ethical and reliable assistant.\n\n"
|
27 |
+
"## User Conversation\n\n"
|
28 |
+
)
|
29 |
+
user_prompt = "### User\n"
|
30 |
+
assistant_prompt = "### Dromedary\n"
|
31 |
+
seperator = "\n\n"
|
32 |
+
|
33 |
+
dtype = torch.bfloat16
|
34 |
+
|
35 |
+
model_path = "path/to/llama-2-70b-hf"
|
36 |
+
qlora_path = "path/to/dromedary-2-70b-qlora-delta-v0" # i.e., this model hub
|
37 |
+
|
38 |
+
bnb_config = BitsAndBytesConfig(
|
39 |
+
load_in_4bit=True,
|
40 |
+
bnb_4bit_compute_dtype=dtype,
|
41 |
+
bnb_4bit_use_double_quant=True,
|
42 |
+
bnb_4bit_quant_type="nf4",
|
43 |
+
)
|
44 |
+
|
45 |
+
model = AutoModelForCausalLM.from_pretrained(
|
46 |
+
model_path,
|
47 |
+
load_in_4bit=True,
|
48 |
+
device_map={"": "cuda:0"},
|
49 |
+
quantization_config=bnb_config,
|
50 |
+
torch_dtype=dtype,
|
51 |
+
)
|
52 |
+
|
53 |
+
model = PeftModel.from_pretrained(
|
54 |
+
model,
|
55 |
+
qlora_path,
|
56 |
+
is_trainable=False,
|
57 |
+
)
|
58 |
+
```
|
59 |
+
|
60 |
+
**Model date:**
|
61 |
+
Dromedary was trained between July 2023 and Aug 2023, but its knowledge only goes up until Sept-2022.
|
62 |
+
|
63 |
+
**License:**
|
64 |
+
LLaMA-2's bespoke license
|
65 |
+
|
66 |
+
## More Information
|
67 |
+
|
68 |
+
**Paper or resources for more information:**
|
69 |
+
[placeholder]
|
70 |
+
|
71 |
+
**Where to send questions or comments about the model:**
|
72 |
+
https://github.com/IBM/SALMON/issues
|
73 |
+
|
74 |
+
**Organizations developing the model:**
|
75 |
+
The Self-Align team is a joint effort between CMU and IBM.
|
76 |
+
|
77 |
+
## Intended use
|
78 |
+
**Primary intended uses:**
|
79 |
+
The primary use of Dromedary is research on the alignment of large language models.
|
80 |
+
|
81 |
+
**Primary intended users:**
|
82 |
+
The primary intended users of the model are researchers in artificial intelligence.
|
83 |
+
|
84 |
+
## Training dataset
|
85 |
+
6 In-Context Learning (ICL) exemplars
|
86 |
+
|
87 |
+
90K unlabeled prompts from ShareGPT
|
88 |
+
|
89 |
+
10K unlabeled prompts from databricks-dolly-15k
|
90 |
+
|
91 |
+
10K unlabeled prompts from OpenAssistant Conversations
|
92 |
+
|
93 |
+
40K unlabeled prompts from OpenOrca
|
94 |
+
|
95 |
+
7.5K unlabeled prompts from MATH
|
96 |
+
|
97 |
+
## Evaluation dataset
|
98 |
+
We evaluate Dromedary-2 on:
|
99 |
+
1. Chatbot benchmarks: Vicuna-Bench, MT-Bench, AlpacaEval
|
100 |
+
2. Capability benchmarks: Big-Bench Hard (reasoning), HumanEval (coding), TydiQA (multilingualism)
|
101 |
+
3. Truthfulness benchmarks: TruthfulQA
|