Spaces:
Runtime error
Runtime error
File size: 1,796 Bytes
0140c70 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
@echo off
REM ���python��װ
SET PYTHON_VERSION=3.10.2
SET PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/%PYTHON_VERSION%/python-%PYTHON_VERSION%-amd64.exe
python --version >NUL 2>&1
if %ERRORLEVEL% neq 0 (
echo Python is not installed. Attempting to install Python %PYTHON_VERSION%...
bitsadmin /transfer "PythonInstaller" %PYTHON_INSTALLER_URL% python-installer.exe
start /wait python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
del /f python-installer.exe
python --version >NUL 2>&1
if %ERRORLEVEL% neq 0 (
echo Failed to install Python.
pause >nul
exit /b 1
)
)
echo Python installed.
REM �������ⴴ��
if not exist "myenv" (
echo ���ڴ��������...
python -m venv myenv
if %ERRORLEVEL% neq 0 (
echo ���������ʧ�ܣ����� python �Ƿ�װ����Լ� python �汾�Ƿ�Ϊ64λ�汾��python 3.10����python��Ŀ¼�Ƿ��ڻ�������PATH�ڡ�
pause >nul
exit /b 1
)
)
call myenv\Scripts\activate
REM ͨ���ȸ�����������ʹ�þ���
set "target_url=www.google.com"
set "timeout=3000"
ping %target_url% -n 1 -w %timeout% >nul
if %errorlevel% neq 0 (
echo Use CN
set PIP_DISABLE_PIP_VERSION_CHECK=1
set PIP_NO_CACHE_DIR=1
set PIP_INDEX_URL=https://mirror.baidu.com/pypi/simple
) else (
echo Use default
)
set HF_HOME=huggingface
REM ��װ����
echo Installing deps...
echo ��װ����
python -m pip install --upgrade pip
pip install -r ./install_script/requirements.txt
if %ERRORLEVEL% neq 0 (
echo Deps install failed
echo ������װʧ�ܡ�
pause >nul
exit /b 1
)
echo.
echo Install completed, please run Start to open the GUI
echo ��װ��ϣ�������Start��GUI
echo.
pause |