forked from mindspore-lab/mindnlp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mindspore-lab:master' into master
- Loading branch information
Showing
2,905 changed files
with
1,303,254 additions
and
63,278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,33 @@ | ||
import re | ||
import requests | ||
import os | ||
import platform | ||
|
||
def gen_url(os, py_version): | ||
hf_url = 'https://huggingface.co/lvyufeng/mindspore-daily/resolve/main/' | ||
def gen_url(os_name, py_version): | ||
hf_url = 'https://hf.co/lvyufeng/mindspore-daily/resolve/main/' | ||
whl_name = 'mindspore-newest-cp{}-cp{}-{}.whl' | ||
py_version = py_version.replace('.', '') | ||
|
||
if os == 'ubuntu-latest': | ||
platform = 'linux_x86_64' | ||
elif os == 'macos-latest': | ||
platform = 'macosx_10_15_x86_64' | ||
elif os == 'windows-latest': | ||
platform = 'win_amd64' | ||
if os_name == 'ubuntu-latest' or 'linux' in os_name: | ||
os_type = 'linux_x86_64' | ||
elif os_name == 'macos-latest' or 'mac' in os_name: | ||
machine = platform.machine() | ||
if machine.startswith('arm'): | ||
os_type = 'macosx_11_0_arm64' | ||
else: | ||
os_type = 'macosx_10_15_x86_64' | ||
elif os_name == 'windows-latest': | ||
os_type = 'win_amd64' | ||
else: | ||
raise ValueError(f'not support this operate system {os}') | ||
raise ValueError(f'not support this operate system {os_name}') | ||
|
||
py_version2 = py_version if py_version != '37' else py_version + 'm' | ||
whl_name = whl_name.format(py_version, py_version2, platform) | ||
whl_name = whl_name.format(py_version, py_version2, os_type) | ||
|
||
with open('download.txt', 'w', encoding='utf-8') as f: | ||
f.write(hf_url + whl_name) | ||
|
||
if __name__ == '__main__': | ||
platform = os.environ['OS'] | ||
os_type = os.environ['OS'] | ||
python = os.environ['PYTHON'] | ||
gen_url(platform, python) | ||
gen_url(os_type, python) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.