Skip to content

Commit 1a5e957

Browse files
committed
First effort towards autobuilding visualization.
1 parent 99c798a commit 1a5e957

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Jekyll site CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Build the site in the jekyll/builder container
16+
run: |
17+
docker run \
18+
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
19+
jekyll/builder:latest /bin/bash -c "chmod 777 /srv/jekyll && jekyll build --future"
20+
- uses: actions/checkout@v2
21+
- name: Compute tSNE Embeddings
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: '3.7'
25+
architecture: x64
26+
- run: |
27+
python -m pip install transformers sklearn numpy
28+
python -m pip install pip install torch==1.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
29+
python ${{ github.workspace }}/etc/compute_embeddings.py ${{ github.workspace }}/_site/papers-abstracts.json ${{ github.workspace }}/_site/tsne.json

etc/compute_embeddings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def parse_arguments():
1111
parser = argparse.ArgumentParser(description="TSNE Visualization of Papers in ML4Code")
1212

1313
parser.add_argument("json", default=False, help="the path the json containing all papers.")
14+
parser.add_argument("outpath", default=False, help="the target path of the visualizations papers.")
1415
parser.add_argument("--seed", default=0, help="The seed for TSNE.", type=int)
1516
return parser.parse_args()
1617

@@ -40,5 +41,5 @@ def parse_arguments():
4041
for i, paper_info in enumerate(data):
4142
paper_info['tsne_embedding'] = out[i].tolist()
4243

43-
with open('tsne.json', 'w') as f:
44+
with open(args.outpath, 'w') as f:
4445
json.dump(data, f)

0 commit comments

Comments
 (0)