File size: 1,283 Bytes
6ea04ef
 
 
 
 
bceceb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7aae401
 
60de117
 
 
 
5887b84
 
 
 
 
0de2e34
 
 
 
 
5887b84
 
 
ecb9f74
 
 
 
 
5887b84
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
license: apache-2.0
language:
- en
---
## Preparing the dataset

### NOTICE:

All code is owned by Hugging Face and uses the Apache 2.0 Licence. While I clean and strip the dataset for processing, do note that this dataset is under the same scruteny as the original Apache 2.0 License.

## Clone Repo

Data souce used is the [accelerate](https://github.com/huggingface/accelerate) repository. I'm using the latest version, v0.25.0

```bash
git clone https://github.com/huggingface/accelerate
cd accelerate
git checkout v0.25.0
cd ..
mkdir docs src
mv accelerate/src/accelerate/* src
mv accelerate/docs/* docs
cd src
rm __init__.py commands/__init__.py test_utils/__init__.py utils/__init__.py
```

### Cleaning the dataset

Using `regex` in VSCODE, use the following replacement:

```regex
# Copyright(.*\n)+# limitations under the license.
```

```regex
<!--Copyright(.*\n)+-->
```

In the source:
```regex
    """

    
```
To:
```regex
    """
    
```
Then remove all import statements (as we only care about the content).

Strip all blank spaces/whitespace:
```regex
^(?:[\t ]*(?:\r?\n|\r))+
```

**WARNING**: It is known that this will seperate out the `_inner()` in the source code and use it as a seperate function losing the context. Trying out with this issue for now.