Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
update html
Browse files Browse the repository at this point in the history
  • Loading branch information
KumaTea committed Dec 19, 2020
1 parent 553a8da commit 28a1756
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 31 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.idea
whl
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PyTorch, torchvision and torchaudio wheel for aarch64 / ARM64 devices

Run:

`pip install torch torchvision torchaudio -f https://torch.maku.ml/whl/torch.html # not done yet`
`pip install torch torchvision torchaudio -f https://torch.maku.ml/whl/stable.html`

Note: this command installs the latest version.
If you want a specific version, please check the [Corresponding Versions](#corresponding-versions) section.
Expand Down
3 changes: 3 additions & 0 deletions releases/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<script>
window.location.replace('https://github.com/KumaTea/pytorch-aarch64/releases');
</script>
23 changes: 0 additions & 23 deletions src/api.py

This file was deleted.

27 changes: 21 additions & 6 deletions src/functions.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import json
import requests
from datetime import datetime
from urllib.parse import quote_plus


author = 'KumaTea'
project = 'pytorch-aarch64'
whl_dir = '../whl'
whl_file = 'stable.html'
pt = 'pytorch'
pt_ci_index = './pt_ci.json' # pytorch official CI builds
gh_rl_index = './gh_rl.json' # GitHub released wheels
Expand All @@ -20,12 +21,26 @@ def get_pt_ci():


def get_gh_rl():
assets = []
result_raw = requests.get(gh_rl_api).json()
pass


def update_index():
pass
for release in result_raw:
if release['assets']:
for binary in release['assets']:
assets.append({
'name': binary['name'],
'url': binary['browser_download_url']
})
return assets


def gen_index():
whl_list = get_gh_rl()
html = ''
for file in whl_list:
html += '<a href=\"' + quote_plus(file['name']) + '\"</a>' + \
quote_plus(file['url']) + '<br>\n'
with open(f'{whl_dir}/{whl_file}', 'w', encoding='utf-8') as html_file:
html_file.write(html)


def get_status():
Expand Down
5 changes: 5 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from functions import gen_index


if __name__ == '__main__':
gen_index()
12 changes: 12 additions & 0 deletions whl/stable.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<a href="torch-1.7.1-cp36-cp36m-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorch-1.7.1-cp36-cp36m-linux_aarch64.whl<br>
<a href="torch-1.7.1-cp37-cp37m-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorch-1.7.1-cp37-cp37m-linux_aarch64.whl<br>
<a href="torch-1.7.1-cp38-cp38-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorch-1.7.1-cp38-cp38-linux_aarch64.whl<br>
<a href="torch-1.7.1-cp39-cp39-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorch-1.7.1-cp39-cp39-linux_aarch64.whl<br>
<a href="torchaudio-0.7.2-cp36-cp36m-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorchaudio-0.7.2-cp36-cp36m-linux_aarch64.whl<br>
<a href="torchaudio-0.7.2-cp37-cp37m-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorchaudio-0.7.2-cp37-cp37m-linux_aarch64.whl<br>
<a href="torchaudio-0.7.2-cp38-cp38-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorchaudio-0.7.2-cp38-cp38-linux_aarch64.whl<br>
<a href="torchaudio-0.7.2-cp39-cp39-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorchaudio-0.7.2-cp39-cp39-linux_aarch64.whl<br>
<a href="torchvision-0.8.2-cp36-cp36m-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorchvision-0.8.2-cp36-cp36m-linux_aarch64.whl<br>
<a href="torchvision-0.8.2-cp37-cp37m-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorchvision-0.8.2-cp37-cp37m-linux_aarch64.whl<br>
<a href="torchvision-0.8.2-cp38-cp38-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorchvision-0.8.2-cp38-cp38-linux_aarch64.whl<br>
<a href="torchvision-0.8.2-cp39-cp39-linux_aarch64.whl"</a>https%3A%2F%2Fgithub.com%2FKumaTea%2Fpytorch-aarch64%2Freleases%2Fdownload%2F2012%2Ftorchvision-0.8.2-cp39-cp39-linux_aarch64.whl<br>

0 comments on commit 28a1756

Please sign in to comment.