andreaskoepf commited on
Commit
d0945e8
1 Parent(s): e94cc49

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +70 -0
README.md CHANGED
@@ -1,11 +1,81 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
4
  - base model: [tiiuae/falcon-7b](https://huggingface.co/tiiuae/falcon-7b)
5
  - [sampling report](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-mix-2000_sampling_noprefix2.json)
6
  - wandb: https://wandb.ai/open-assistant/public-sft/runs/tlevhltw
7
  - checkpoint: 2000 steps (~2.9 epochs)
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  Model:
10
  ```
11
  falcon-7b:
 
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
  ---
22
+ # Open-Assistant Falcon 7B SFT MIX Model
23
+
24
  - base model: [tiiuae/falcon-7b](https://huggingface.co/tiiuae/falcon-7b)
25
  - [sampling report](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-mix-2000_sampling_noprefix2.json)
26
  - wandb: https://wandb.ai/open-assistant/public-sft/runs/tlevhltw
27
  - checkpoint: 2000 steps (~2.9 epochs)
28
 
29
+ ## Prompting
30
+
31
+ Two special tokens are used to mark the beginning of user and assistant turns:
32
+ `<|prompter|>` and `<|assistant|>`. Each turn ends with a `<|endoftext|>` token.
33
+
34
+ Input prompt example:
35
+ ```
36
+ <|prompter|>What is a meme, and what's the history behind this word?<|endoftext|><|assistant|>
37
+ ```
38
+ The input ends with the `<|assistant|>` token to signal that the model should
39
+ start generating the assistant reply.
40
+
41
+
42
+ ## Sample Code
43
+
44
+ ```python
45
+ from transformers import AutoTokenizer
46
+ import transformers
47
+ import torch
48
+
49
+ model = "OpenAssistant/falcon-7b-sft-mix-2000"
50
+
51
+ tokenizer = AutoTokenizer.from_pretrained(model)
52
+ pipeline = transformers.pipeline(
53
+ "text-generation",
54
+ model=model,
55
+ tokenizer=tokenizer,
56
+ torch_dtype=torch.bfloat16,
57
+ trust_remote_code=True,
58
+ device_map="auto",
59
+ )
60
+
61
+ input_text="<|prompter|>What is a meme, and what's the history behind this word?<|endoftext|><|assistant|>"
62
+
63
+ sequences = pipeline(
64
+ input_text,
65
+ max_length=500,
66
+ do_sample=True,
67
+ return_full_text=False,
68
+ top_k=10,
69
+ num_return_sequences=1,
70
+ eos_token_id=tokenizer.eos_token_id,
71
+ )
72
+ for seq in sequences:
73
+ print(f"Result: {seq['generated_text']}")
74
+ ```
75
+
76
+
77
+ ## Configuration Details
78
+
79
  Model:
80
  ```
81
  falcon-7b: