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HHHHH#,***,***,***,***,***,***,***,***,***,***,***,**HHHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHH..HHH,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*#HHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHH,,,**,/H*,***,***,***,,,*,***,***,***,**,,,**,***,***,***H,,*,***HHHHHHHH
|
|
|
|
echo HHHHHH.*,,,*,,,,,*,*,*,***#HHHHH.,,*,*,*,*,**/HHHHH.,*,*,*,*,*,*,*,*****HHHHHHHH
|
|
|
|
echo HHHHHH.*,***,*,*,***,***,.HHHHHHH/**,***,****HHHHHHH.***,***,***,*******HHHHHHHH
|
|
|
|
echo HHHHHH.,,,,,,,,,,,,,,,,,,,.HHHHH.,,,,,,,,,,,,.HHHHHH,,,,,,,,,,,,,,,,,***HHHHHHHH
|
|
|
|
echo HHHHHH.,,,,,,/H,,,**,***,***,,,*,***,***,***,**,,,,*,***,***,***H***,***HHHHHHHH
|
|
|
|
echo HHHHHHH.,,,,*.H,,,,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,***H*,,,,/HHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHH*,***,***,**,,***,***,***,***,***,***,***,***,**.HHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHHH,,,,,,,,*,,#H#,,,,,*,,,*,,,,,,,,*#H*,,,,,,,,,**HHHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHHHH,,*,***,***,**/.HHHHHHHHHHHHH#*,,,*,***,***,*HHHHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHHHHH,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*HHHHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHHHHH**,***,***,***,***,***,***,***,***,***,***,*.HHHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHHHHH*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*HHHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHHHHH**,***,***,*******/..HHHHHHHHH.#/*,*,,,***,***HHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHHHH*,*,*,******#HHHHHHHHHHHHHHHHHHHHHHHHHHHH./**,,,.HHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHHH.,,*,***.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.*#HHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHH/,,,*.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHH,,#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHH.HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
|
|
|
echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
|
|
|
|
2023-04-06 20:16:52 +00:00
|
|
|
if not exist "./tmp" mkdir "./tmp"
|
2023-04-06 20:07:20 +00:00
|
|
|
|
2023-04-06 19:12:49 +00:00
|
|
|
REM Check if Python is installed
|
|
|
|
set /p="Checking for python..." <nul
|
2023-04-06 20:07:20 +00:00
|
|
|
where python >nul 2>&1
|
|
|
|
if %errorlevel% neq 0 (
|
|
|
|
set /p choice=Python is not installed. Would you like to install Python? [Y/N]
|
|
|
|
if /i ".choice." equ "Y" (
|
2023-04-06 19:12:49 +00:00
|
|
|
REM Download Python installer
|
|
|
|
echo Downloading Python installer...
|
2023-04-06 20:16:52 +00:00
|
|
|
powershell -Command "Invoke-WebRequest -Uri 'https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe' -OutFile 'tmp/python.exe'"
|
2023-04-06 19:12:49 +00:00
|
|
|
REM Install Python
|
|
|
|
echo Installing Python...
|
2023-04-06 20:16:52 +00:00
|
|
|
tmp/python.exe /quiet /norestart
|
2023-04-06 19:12:49 +00:00
|
|
|
) else (
|
|
|
|
echo Please install Python and try again.
|
|
|
|
pause
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
) else (
|
|
|
|
echo OK
|
|
|
|
)
|
|
|
|
|
2023-04-06 20:07:20 +00:00
|
|
|
|
2023-04-06 19:12:49 +00:00
|
|
|
REM Check if pip is installed
|
|
|
|
set /p="Checking for pip..." <nul
|
|
|
|
python -m pip >nul 2>&1
|
2023-04-06 20:07:20 +00:00
|
|
|
if %errorlevel% neq 0 (
|
|
|
|
set /p choice=Pip is not installed. Would you like to install pip? [Y/N]
|
|
|
|
if /i ".choice." equ "Y" (
|
2023-04-06 19:12:49 +00:00
|
|
|
REM Download get-pip.py
|
|
|
|
echo Downloading get-pip.py...
|
2023-04-06 20:16:52 +00:00
|
|
|
powershell -Command "Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'tmp/get-pip.py'"
|
2023-04-06 19:12:49 +00:00
|
|
|
REM Install pip
|
|
|
|
echo Installing pip...
|
2023-04-06 20:16:52 +00:00
|
|
|
python tmp/get-pip.py
|
2023-04-06 20:07:20 +00:00
|
|
|
) else .
|
2023-04-06 19:12:49 +00:00
|
|
|
echo Please install pip and try again.
|
|
|
|
pause
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
) else (
|
|
|
|
echo OK
|
|
|
|
)
|
|
|
|
|
|
|
|
REM Check if venv module is available
|
|
|
|
set /p="Checking for venv..." <nul
|
|
|
|
python -c "import venv" >nul 2>&1
|
2023-04-06 20:07:20 +00:00
|
|
|
if %errorlevel% neq 0 (
|
|
|
|
set /p choice=venv module is not available. Would you like to upgrade Python to the latest version? [Y/N]
|
|
|
|
if /i ".choice." equ "Y" (
|
2023-04-06 19:12:49 +00:00
|
|
|
REM Upgrade Python
|
|
|
|
echo Upgrading Python...
|
|
|
|
python -m pip install --upgrade pip setuptools wheel
|
|
|
|
python -m pip install --upgrade --user python
|
|
|
|
) else (
|
|
|
|
echo Please upgrade your Python installation and try again.
|
|
|
|
pause
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
) else (
|
|
|
|
echo OK
|
|
|
|
)
|
|
|
|
|
|
|
|
REM Create a new virtual environment
|
|
|
|
set /p="Creating virtual environment ..." <nul
|
|
|
|
python -m venv env
|
2023-04-06 20:07:20 +00:00
|
|
|
if %errorlevel% neq 0 (
|
2023-04-06 19:12:49 +00:00
|
|
|
echo Failed to create virtual environment. Please check your Python installation and try again.
|
|
|
|
pause
|
|
|
|
exit /b 1
|
|
|
|
) else (
|
|
|
|
echo OK
|
|
|
|
)
|
|
|
|
|
|
|
|
REM Activate the virtual environment
|
|
|
|
set /p="Activating virtual environment ..." <nul
|
|
|
|
call env\Scripts\activate.bat
|
|
|
|
echo OK
|
|
|
|
REM Install the required packages
|
|
|
|
echo Installing requirements ...
|
|
|
|
python -m pip install pip --upgrade
|
|
|
|
python -m pip install -r requirements.txt
|
2023-04-06 20:07:20 +00:00
|
|
|
if .ERRORLEVEL. neq 0 (
|
2023-04-06 19:12:49 +00:00
|
|
|
echo Failed to install required packages. Please check your internet connection and try again.
|
|
|
|
pause
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
|
2023-04-06 20:16:52 +00:00
|
|
|
echo Downloading latest model
|
|
|
|
powershell -Command "Invoke-WebRequest -Uri 'https://the-eye.eu/public/AI/models/nomic-ai/gpt4all/gpt4all-lora-quantized-ggml.bin' -OutFile 'models/gpt4all-lora-quantized-ggml.bin'"
|
|
|
|
|
|
|
|
echo Cleaning tmp folder
|
|
|
|
rd /s /q "./tmp"
|
|
|
|
|
2023-04-06 21:26:42 +00:00
|
|
|
echo Virtual environment created and packages installed successfully.
|
|
|
|
echo Every thing is setup. Just run run.bat
|
2023-04-06 19:12:49 +00:00
|
|
|
pause
|
|
|
|
exit /b 0
|