Commit
·
f20b50a
1
Parent(s):
0fe2440
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,145 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
- de
|
6 |
+
- es
|
7 |
+
- fr
|
8 |
+
tags:
|
9 |
+
- sft
|
10 |
+
pipeline_tag: text-generation
|
11 |
+
widget:
|
12 |
+
- text: >-
|
13 |
+
<|prompter|>What is a meme, and what's the history behind this
|
14 |
+
word?<|endoftext|><|assistant|>
|
15 |
+
- text: <|prompter|>What's the Earth total population<|endoftext|><|assistant|>
|
16 |
+
- text: >-
|
17 |
+
<|prompter|>Write a story about future of AI
|
18 |
+
development<|endoftext|><|assistant|>
|
19 |
+
datasets:
|
20 |
+
- OpenAssistant/oasst1
|
21 |
+
library_name: transformers
|
22 |
---
|
23 |
+

|
24 |
+
## I am still building the structure of these descriptions.
|
25 |
+
These will carry increasingly more content to help find the best models for a purpose.
|
26 |
+
|
27 |
+
This is a gguf quantized version of
|
28 |
+
|
29 |
+
https://huggingface.co/OpenAssistant/falcon-7b-sft-top1-696
|
30 |
+
|
31 |
+
# Original Model Card:
|
32 |
+
|
33 |
+
# Open-Assistant Falcon 7B SFT OASST-TOP1 Model
|
34 |
+
|
35 |
+
This model is a fine-tuning of TII's [Falcon 7B](https://huggingface.co/tiiuae/falcon-7b) LLM.
|
36 |
+
It was trained with 11,123 top-1 (high-quality) demonstrations of the OASST data set (exported on June 2, 2023) with a batch size of 128 for 8 epochs with LIMA style dropout (p=0.2) and a context-length of 2048 tokens.
|
37 |
+
|
38 |
+
## Model Details
|
39 |
+
|
40 |
+
- **Finetuned from:** [tiiuae/falcon-7b](https://huggingface.co/tiiuae/falcon-7b)
|
41 |
+
- **Model type:** Causal decoder-only transformer language model
|
42 |
+
- **Language:** English, German, Spanish, French (and limited capabilities in Italian, Portuguese, Polish, Dutch, Romanian, Czech, Swedish);
|
43 |
+
- **Weights & Biases:** [Training log](https://wandb.ai/open-assistant/public-sft/runs/25apbcld) (Checkpoint: 696 steps)
|
44 |
+
- **Code:** [Open-Assistant/model/model_training](https://github.com/LAION-AI/Open-Assistant/tree/main/model/model_training)
|
45 |
+
- **Demo:** [Continuations for 250 random prompts](https://open-assistant.github.io/oasst-model-eval/?f=https%3A%2F%2Fraw.githubusercontent.com%2FOpen-Assistant%2Foasst-model-eval%2Fmain%2Fsampling_reports%2Fchat-gpt%2F2023-04-11_gpt-3.5-turbo_lottery.json%0Ahttps%3A%2F%2Fraw.githubusercontent.com%2FOpen-Assistant%2Foasst-model-eval%2Fmain%2Fsampling_reports%2Foasst-sft%2F2023-06-05_OpenAssistant_falcon-7b-sft-top1-696_sampling_noprefix2.json)
|
46 |
+
- **License:** Apache 2.0
|
47 |
+
- **Contact:** [Open-Assistant Discord](https://ykilcher.com/open-assistant-discord)
|
48 |
+
|
49 |
+
|
50 |
+
## Prompting
|
51 |
+
|
52 |
+
Two special tokens are used to mark the beginning of user and assistant turns:
|
53 |
+
`<|prompter|>` and `<|assistant|>`. Each turn ends with a `<|endoftext|>` token.
|
54 |
+
|
55 |
+
Input prompt example:
|
56 |
+
```
|
57 |
+
<|prompter|>What is a meme, and what's the history behind this word?<|endoftext|><|assistant|>
|
58 |
+
```
|
59 |
+
The input ends with the `<|assistant|>` token to signal that the model should
|
60 |
+
start generating the assistant reply.
|
61 |
+
|
62 |
+
|
63 |
+
## Sample Code
|
64 |
+
|
65 |
+
```python
|
66 |
+
from transformers import AutoTokenizer
|
67 |
+
import transformers
|
68 |
+
import torch
|
69 |
+
|
70 |
+
model = "OpenAssistant/falcon-7b-sft-top1-696"
|
71 |
+
|
72 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
73 |
+
pipeline = transformers.pipeline(
|
74 |
+
"text-generation",
|
75 |
+
model=model,
|
76 |
+
tokenizer=tokenizer,
|
77 |
+
torch_dtype=torch.bfloat16,
|
78 |
+
trust_remote_code=True,
|
79 |
+
device_map="auto",
|
80 |
+
)
|
81 |
+
|
82 |
+
input_text="<|prompter|>What is a meme, and what's the history behind this word?<|endoftext|><|assistant|>"
|
83 |
+
|
84 |
+
sequences = pipeline(
|
85 |
+
input_text,
|
86 |
+
max_length=500,
|
87 |
+
do_sample=True,
|
88 |
+
return_full_text=False,
|
89 |
+
top_k=10,
|
90 |
+
num_return_sequences=1,
|
91 |
+
eos_token_id=tokenizer.eos_token_id,
|
92 |
+
)
|
93 |
+
for seq in sequences:
|
94 |
+
print(f"Result: {seq['generated_text']}")
|
95 |
+
```
|
96 |
+
|
97 |
+
|
98 |
+
## Configuration Details
|
99 |
+
|
100 |
+
Model:
|
101 |
+
```
|
102 |
+
falcon-7b:
|
103 |
+
dtype: bf16
|
104 |
+
log_dir: "falcon_log_7b"
|
105 |
+
learning_rate: 1e-5
|
106 |
+
model_name: "tiiuae/falcon-7b"
|
107 |
+
deepspeed_config: configs/zero_config.json
|
108 |
+
output_dir: falcon
|
109 |
+
weight_decay: 0.0
|
110 |
+
max_length: 2048
|
111 |
+
save_strategy: steps
|
112 |
+
eval_steps: 80
|
113 |
+
save_steps: 80
|
114 |
+
warmup_steps: 20
|
115 |
+
gradient_checkpointing: true
|
116 |
+
gradient_accumulation_steps: 4
|
117 |
+
per_device_train_batch_size: 4
|
118 |
+
per_device_eval_batch_size: 8
|
119 |
+
num_train_epochs: 8
|
120 |
+
save_total_limit: 4
|
121 |
+
residual_dropout: 0.2
|
122 |
+
residual_dropout_lima: true
|
123 |
+
```
|
124 |
+
|
125 |
+
Dataset:
|
126 |
+
```
|
127 |
+
oasst-top1:
|
128 |
+
# oasst_export: 11123 (100.00%)
|
129 |
+
datasets:
|
130 |
+
- oasst_export:
|
131 |
+
lang: "bg,ca,cs,da,de,en,es,fr,hr,hu,it,nl,pl,pt,ro,ru,sl,sr,sv,uk" # sft-8.0
|
132 |
+
input_file_path: 2023-06-02_oasst_all_labels.jsonl.gz
|
133 |
+
val_split: 0.05
|
134 |
+
top_k: 1
|
135 |
+
```
|
136 |
+
|
137 |
+
Train command:
|
138 |
+
```
|
139 |
+
deepspeed trainer_sft.py --configs defaults falcon-7b oasst-top1 --cache_dir <data_cache_dir> --output_dir <output_path> --deepspeed
|
140 |
+
```
|
141 |
+
|
142 |
+
Export command:
|
143 |
+
```
|
144 |
+
python export_model.py --dtype bf16 --hf_repo_name OpenAssistant/falcon-7b-sft-top1 --trust_remote_code --auth_token <auth_token> <output_path> --max_shard_size 2GB
|
145 |
+
```
|