File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import zipfile
2+ from pathlib import Path
3+
4+ from labml import lab , monit
5+
6+
7+ def main ():
8+ download = Path (lab .get_data_path () / 'download' )
9+ source = Path (lab .get_data_path () / 'source' )
10+
11+ for repo in download .iterdir ():
12+ with monit .section (f"Extract { repo .stem } " ):
13+ repo_source = source / repo .stem
14+ if repo_source .exists ():
15+ continue
16+ with zipfile .ZipFile (repo , 'r' ) as repo_zip :
17+ repo_zip .extractall (repo_source )
18+
19+ if not source .exists ():
20+ source .mkdir (parents = True )
21+
22+
23+ if __name__ == '__main__' :
24+ main ()
Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ This repo trains deep learning models on source code.
66
771 . Clone this repo
882 . Install requirements from ` requirements.txt `
9- 3 . Download Github repos by running ` download.py ` .
9+ 3 . Download Github repos by running ` python_autocomplete/ download.py` .
1010 It downloads all the repos mentioned in
1111 [ PyTorch awesome list] ( https://github.com/bharathgs/Awesome-pytorch-list ) .
12- 4 . Run ` extrat_downloads.sh ` to extract the downloaded zip files to ` data/source ` .
12+ 4 . Run ` python_autocomplete/extract_downloads.py ` to extract the downloaded zip files to ` data/source ` .
1313 You can directly copy any python code to ` data/source ` to train on them.
14145 . Run ` create_dataset.py ` to collect all python files.
1515 The collected code will be written to ` data/train.py ` and, ` data/eval.py ` .
You can’t perform that action at this time.
0 commit comments