You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48-9Lines changed: 48 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ huggingface-cli login
20
20
## Fine-Tuning (`finetune.py`)
21
21
💫 StarCoder can be fine-tuned to achieve multiple downstream tasks. Our interest here is to fine-tune StarCoder in order to make it follow instructions. [Instruction fine-tuning](https://arxiv.org/pdf/2109.01652.pdf) has gained a lot of attention recently as it proposes a simple framework that teaches language models to align their outputs with human needs. That procedure requires the availability of quality instruction datasets, which contain multiple `instruction - answer` pairs. Unfortunately such datasets are not ubiquitous but thanks to Hugging Face 🤗's [datasets](https://github.com/huggingface/datasets) library we can have access to some good proxies. To fine-tune cheaply and efficiently, we use Hugging Face 🤗's [PEFT](https://github.com/huggingface/peft) as well as Tim Dettmers' bitsandbytes.
22
22
23
-
### Code Alpaca
23
+
### Code Alpaca (CA)
24
24
[Code Alpaca](https://huggingface.co/datasets/HuggingFaceH4/CodeAlpaca_20K) is a dataset of about 20K `prompt - completion` pairs generated by the technique presented in the [self-instruct](https://arxiv.org/abs/2212.10560) paper. Each prompt describes a task that is asked by a user and the corresponding completion is the answer to that task as generated by `text-davinci-003`.
25
25
26
26
To execute the fine-tuning script run the following command:
[Stack Exchange](https://en.wikipedia.org/wiki/Stack_Exchange) is a well-known network of Q&A websites on topics in diverse fields. It is a place where a user can ask a question and obtain answers from other users. Those answers are scored and ranked based on their quality. [Stack exchange instruction](https://huggingface.co/datasets/ArmelR/stack-exchange-instruction) is a dataset that was obtained by scrapping the site in order to build a collection of Q&A pairs. A language model can then be fine-tuned on that dataset to make it elicit strong and diverse question-answering skills.
62
62
63
63
To execute the fine-tuning script run the following command:
**Instruction**: Write a function to output the harmonic mean of a list of elements. Make sure to check if the list is empty and ignore the elements that are equal to 0.
119
+
**Instruction**: Write a function to compute the geometric mean of a list of numbers.
120
120
121
121
**StarCoder's answer**:
122
122
123
-
**Instruction**:
123
+
```python
124
+
defgeometric_mean(nums):
125
+
product =1
126
+
for num in nums:
127
+
product *= num
128
+
return product**(1/len(nums))
124
129
125
-
**StarCoder's answer**:
130
+
```
126
131
127
-
```bash
132
+
**Instruction**:
133
+
what is the purpose of the following code?
134
+
```python
135
+
deffunction(n):
136
+
s =""
137
+
while n >0 :
138
+
s =str(n%3)+s
139
+
n = n//3
140
+
return s
141
+
```
128
142
143
+
**StarCoder's answer**:
144
+
```
145
+
The purpose of the code is to convert a given number n to a string of its base 3 representation. This is done by dividing the number by 3 and converting the remainder to a string and then adding it to the string of the previous iteration. This process is repeated until the number is 0.
0 commit comments