Просмотр исходного кода

对脚本的一点小修改 (#414)

* Start.bat也要路径校验

* 安装环境的其他链接也要尊重USE_MIRROR
Guanghua Lu 1 год назад
Родитель
Сommit
46440f25be
2 измененных файлов с 17 добавлено и 2 удалено
  1. 9 2
      install_env.bat
  2. 8 0
      start.bat

+ 9 - 2
install_env.bat

@@ -33,7 +33,10 @@ set INSTALL_ENV_DIR=%cd%\fishenv\env
 set PIP_CMD=%cd%\fishenv\env\python -m pip
 set PYTHON_CMD=%cd%\fishenv\env\python
 set API_FLAG_PATH=%~dp0API_FLAGS.txt
-set MINICONDA_DOWNLOAD_URL=https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py310_23.3.1-0-Windows-x86_64.exe
+set MINICONDA_DOWNLOAD_URL=https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Windows-x86_64.exe
+if "!USE_MIRROR!" == "true" (
+    set MINICONDA_DOWNLOAD_URL=https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py310_23.3.1-0-Windows-x86_64.exe
+)
 set MINICONDA_CHECKSUM=307194e1f12bbeb52b083634e89cc67db4f7980bd542254b43d3309eaf7cb358
 set conda_exists=F
 
@@ -86,7 +89,11 @@ if "%conda_exists%" == "F" (
 if not exist "%INSTALL_ENV_DIR%" (
     echo.
     echo Creating Conda Environment...
-    call "%CONDA_ROOT_PREFIX%\_conda.exe" create --no-shortcuts -y -k --prefix "%INSTALL_ENV_DIR%" -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ python=3.10
+    if "!USE_MIRROR!" == "true" (
+        call "%CONDA_ROOT_PREFIX%\_conda.exe" create --no-shortcuts -y -k --prefix "%INSTALL_ENV_DIR%" -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ python=3.10
+    ) else (
+        call "%CONDA_ROOT_PREFIX%\_conda.exe" create --no-shortcuts -y -k --prefix "%INSTALL_ENV_DIR%" python=3.10
+    )
 
     if errorlevel 1 (
         echo.

+ 8 - 0
start.bat

@@ -21,6 +21,14 @@ if "%USE_MIRROR%" == "true" (
 )
 echo "HF_ENDPOINT: !HF_ENDPOINT!"
 echo "NO_PROXY: !no_proxy!"
+
+echo "%CD%"| findstr /R /C:"[!#\$%&()\*+,;<=>?@\[\]\^`{|}~\u4E00-\u9FFF ] " >nul && (
+    echo.
+    echo There are special characters in the current path, please make the path of fish-speech free of special characters before running. && (
+        goto end
+    )
+)
+
 %PYTHON_CMD% .\tools\download_models.py
 
 set "API_FLAGS="