瀏覽代碼

Add mirrors for torch (#857)

* Add mirrors for torch

* set pypi mirror to bfsu, remove version pin

---------

Co-authored-by: Stardust·减 <star_dust_chen@foxmail.com>
SunRuikang 1 年之前
父節點
當前提交
8ae4d19c23
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      install_env.bat

+ 5 - 1
install_env.bat

@@ -133,7 +133,11 @@ if "%USE_MIRROR%"=="true" (
 echo "HF_ENDPOINT: !HF_ENDPOINT!"
 echo "NO_PROXY: !no_proxy!"
 
-%PIP_CMD% install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/cu121
+if "!USE_MIRROR!" == "true" (
+    %PIP_CMD% install torch torchvision torchaudio -U --extra-index-url https://mirrors.bfsu.edu.cn/pypi/web/simple
+) else (
+    %PIP_CMD% install torch torchvision torchaudio -U --index-url https://download.pytorch.org/whl/cu121
+)
 
 %PIP_CMD% install -e . --upgrade-strategy only-if-needed