fix release downloads

This commit is contained in:
Anush Elangovan
2022-09-13 15:00:47 -07:00
parent 23378b6be8
commit 4e4c34c717

View File

@@ -71,11 +71,20 @@ else
echo "${Red}OS not detected. Pray and Play"
fi
TM_HTML_URL="$(python3 -c "import urllib.request, json, sys; \
u=json.loads(urllib.request.urlopen('https://api.github.com/repos/llvm/torch-mlir/releases/latest').read().decode()).get('html_url', False);\
print(u) if u else sys.exit(1);")"
TM_RELEASE_DOWNLOAD_DIR=`dirname ${TM_RELEASE_URL}`
TM_RELEASE_DIR=${TM_HTML_URL/"tag/"/"expanded_assets"/}
echo "TM_RELEASE_URL=${TM_RELEASE_URL}"
echo "TM_RELEASE_DOWNLOAD_DIR=${TM_RELEASE_DOWNLOAD_DIR}"
echo "TM_RELEASE_DIR=${TM_RELEASE_DIR}"
# Upgrade pip and install requirements.
$PYTHON -m pip install --upgrade pip || die "Could not upgrade pip"
$PYTHON -m pip install --upgrade -r "$TD/requirements.txt"
if [ "$torch_mlir_bin" = true ]; then
$PYTHON -m pip install --find-links https://github.com/llvm/torch-mlir/releases torch-mlir --extra-index-url https://download.pytorch.org/whl/nightly/cpu
$PYTHON -m pip install --find-links ${TM_RELEASE_DIR} torch-mlir --extra-index-url ${TM_RELEASE_DIR}
if [ $? -eq 0 ];then
echo "Successfully Installed torch-mlir"
else
@@ -110,7 +119,7 @@ if [[ ! -z "${IMPORTER}" ]]; then
fi
fi
$PYTHON -m pip install -e . --extra-index-url https://download.pytorch.org/whl/nightly/cpu -f https://github.com/llvm/torch-mlir/releases -f https://github.com/${RUNTIME}/releases
$PYTHON -m pip install -e . -f ${${TM_RELEASE_DIR}} -f https://github.com/${RUNTIME}/releases
if [[ $(uname -s) = 'Linux' && ! -z "${IMPORTER}" ]]; then
$PYTHON -m pip uninstall -y torch torchvision