rahuldshetty commited on
Commit
7a82a70
·
1 Parent(s): 7c5d7b2

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +151 -0
README.md ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ inference: false
3
+ tags:
4
+ - generated_from_trainer
5
+ model-index:
6
+ - name: starchat-beta
7
+ results: []
8
+ license: bigcode-openrail-m
9
+ ---
10
+
11
+
12
+ # HuggingFaceH4's Starchat Beta 8-bit quantized
13
+
14
+ ## Prompt template
15
+
16
+ ```
17
+ <|system|> system message goes here <|end|>
18
+ <|user|> prompt goes here <|end|>
19
+ <|assistant|>
20
+ ```
21
+
22
+ Example:
23
+
24
+ ```
25
+ <|system|> Below is a conversation between a human user and a helpful AI coding assistant. <|end|>
26
+ <|user|> How do I sort a list in Python? <|end|>
27
+ <|assistant|>
28
+ ```
29
+
30
+
31
+ # Original model card: HuggingFaceH4's Starchat Beta
32
+
33
+
34
+
35
+ <img src="https://huggingface.co/HuggingFaceH4/starchat-beta/resolve/main/model_logo.png" alt="StarChat Beta Logo" width="800" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
36
+
37
+ # Model Card for StarChat Beta
38
+
39
+ StarChat is a series of language models that are trained to act as helpful coding assistants. StarChat Beta is the second model in the series, and is a fine-tuned version of [StarCoderPlus](https://huggingface.co/bigcode/starcoderplus) that was trained on an ["uncensored"](https://erichartford.com/uncensored-models) variant of the [`openassistant-guanaco` dataset](https://huggingface.co/datasets/timdettmers/openassistant-guanaco). We found that removing the in-built alignment of the OpenAssistant dataset boosted performance on the [Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) and made the model more helpful at coding tasks. However, this means that model is likely to generate problematic text when prompted to do so and should only be used for educational and research purposes.
40
+
41
+ ## Model Details
42
+
43
+ ### Model Description
44
+
45
+ <!-- Provide a longer summary of what this model is. -->
46
+
47
+ - **Model type:** A 16B parameter GPT-like model fine-tuned on an ["uncensored"](https://erichartford.com/uncensored-models) variant of the [`openassistant-guanaco` dataset](https://huggingface.co/datasets/timdettmers/openassistant-guanaco).
48
+ - **Language(s) (NLP):** Primarily English and 80+ programming languages.
49
+ - **License:** BigCode Open RAIL-M v1
50
+ - **Finetuned from model:** [bigcode/starcoderplus](https://huggingface.co/bigcode/starcoderplus)
51
+
52
+ ### Model Sources [optional]
53
+
54
+ <!-- Provide the basic links for the model. -->
55
+
56
+ - **Repository:** https://github.com/bigcode-project/starcoder
57
+ - **Demo:** https://huggingface.co/spaces/HuggingFaceH4/starchat-playground
58
+
59
+
60
+ ## Intended uses & limitations
61
+
62
+ The model was fine-tuned on a variant of the [`OpenAssistant/oasst1`](https://huggingface.co/datasets/OpenAssistant/oasst1) dataset, which contains a diverse range of dialogues in over 35 languages. As a result, the model can be used for chat and you can check out our [demo](https://huggingface.co/spaces/HuggingFaceH4/starchat-playground) to test its coding capabilities.
63
+
64
+ Here's how you can run the model using the `pipeline()` function from 🤗 Transformers:
65
+
66
+ ```python
67
+ import torch
68
+ from transformers import pipeline
69
+
70
+ pipe = pipeline("text-generation", model="rahuldshetty/starchat-beta", device_map="auto")
71
+
72
+ prompt_template = "<|system|>\n<|end|>\n<|user|>\n{query}<|end|>\n<|assistant|>"
73
+ prompt = prompt_template.format(query="How do I sort a list in Python?")
74
+ # We use a special <|end|> token with ID 49155 to denote ends of a turn
75
+ outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.2, top_k=50, top_p=0.95, eos_token_id=49155)
76
+ # You can sort a list in Python by using the sort() method. Here's an example:\n\n```\nnumbers = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]\nnumbers.sort()\nprint(numbers)\n```\n\nThis will sort the list in place and print the sorted list.
77
+ ```
78
+
79
+ ## Bias, Risks, and Limitations
80
+
81
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
82
+
83
+ StarChat Alpha has not been aligned to human preferences with techniques like RLHF or deployed with in-the-loop filtering of responses like ChatGPT, so the model can produce problematic outputs (especially when prompted to do so).
84
+ Models trained primarily on code data will also have a more skewed demographic bias commensurate with the demographics of the GitHub community, for more on this see the [StarCoder dataset](https://huggingface.co/datasets/bigcode/starcoderdata) which is derived from The Stack.
85
+
86
+
87
+ Since the base model was pretrained on a large corpus of code, it may produce code snippets that are syntactically valid but semantically incorrect.
88
+ For example, it may produce code that does not compile or that produces incorrect results.
89
+ It may also produce code that is vulnerable to security exploits.
90
+ We have observed the model also has a tendency to produce false URLs which should be carefully inspected before clicking.
91
+
92
+ StarChat Alpha was fine-tuned from the base model [StarCoder Base](https://huggingface.co/bigcode/starcoderbase), please refer to its model card's [Limitations Section](https://huggingface.co/bigcode/starcoderbase#limitations) for relevant information.
93
+ In particular, the model was evaluated on some categories of gender biases, propensity for toxicity, and risk of suggesting code completions with known security flaws; these evaluations are reported in its [technical report](https://drive.google.com/file/d/1cN-b9GnWtHzQRoE7M7gAEyivY0kl4BYs/view).
94
+
95
+ ## Training and evaluation data
96
+
97
+ StarChat Beta is trained on an ["uncensored"](https://erichartford.com/uncensored-models) variant of the [`openassistant-guanaco` dataset](https://huggingface.co/datasets/timdettmers/openassistant-guanaco). We applied the same [recipe](https://huggingface.co/datasets/ehartford/WizardLM_alpaca_evol_instruct_70k_unfiltered/blob/main/wizardlm_clean.py) used to filter the ShareGPT datasets behind the [WizardLM](https://huggingface.co/datasets/ehartford/WizardLM_alpaca_evol_instruct_70k_unfiltered).
98
+
99
+ ## Training procedure
100
+
101
+ ### Training hyperparameters
102
+
103
+ The following hyperparameters were used during training:
104
+ - learning_rate: 2e-05
105
+ - train_batch_size: 4
106
+ - eval_batch_size: 4
107
+ - seed: 42
108
+ - distributed_type: multi-GPU
109
+ - num_devices: 8
110
+ - gradient_accumulation_steps: 8
111
+ - total_train_batch_size: 256
112
+ - total_eval_batch_size: 32
113
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
114
+ - lr_scheduler_type: cosine
115
+ - lr_scheduler_warmup_ratio: 0.03
116
+ - num_epochs: 6
117
+
118
+ ### Training results
119
+
120
+ | Training Loss | Epoch | Step | Validation Loss |
121
+ |:-------------:|:-----:|:----:|:---------------:|
122
+ | 1.5321 | 0.98 | 15 | 1.2856 |
123
+ | 1.2071 | 1.97 | 30 | 1.2620 |
124
+ | 1.0162 | 2.95 | 45 | 1.2853 |
125
+ | 0.8484 | 4.0 | 61 | 1.3274 |
126
+ | 0.6981 | 4.98 | 76 | 1.3994 |
127
+ | 0.5668 | 5.9 | 90 | 1.4720 |
128
+
129
+
130
+ ### Framework versions
131
+
132
+ - Transformers 4.28.1
133
+ - Pytorch 2.0.1+cu118
134
+ - Datasets 2.12.0
135
+ - Tokenizers 0.13.3
136
+
137
+ ## Citation
138
+
139
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
140
+
141
+ **BibTeX:**
142
+
143
+ ```
144
+ @article{Tunstall2023starchat-alpha,
145
+ author = {Tunstall, Lewis and Lambert, Nathan and Rajani, Nazneen and Beeching, Edward and Le Scao, Teven and von Werra, Leandro and Han, Sheon and Schmid, Philipp and Rush, Alexander},
146
+ title = {Creating a Coding Assistant with StarCoder},
147
+ journal = {Hugging Face Blog},
148
+ year = {2023},
149
+ note = {https://huggingface.co/blog/starchat},
150
+ }
151
+ ```