Add files via upload
This commit is contained in:
parent
27944c4206
commit
d70f1fc72f
1 changed files with 39 additions and 0 deletions
39
Windows-installer.bat
Normal file
39
Windows-installer.bat
Normal file
|
@ -0,0 +1,39 @@
|
|||
@echo off
|
||||
::Install Llama.cpp depencidies, such as Python and CMake (for building llama.exe and quantize.exe)
|
||||
|
||||
if not defined PYTHON (set PYTHON=python)
|
||||
if not defined VENV_DIR (set "VENV_DIR=%~dp0%venv")
|
||||
|
||||
%PYTHON% -V
|
||||
if %ERRORLEVEL% == 0 goto :create_venv
|
||||
echo Python is not installed, installing
|
||||
goto :install_python
|
||||
|
||||
:install_python
|
||||
call bitsadmin /transfer Python-3.10.6 /download /priority FOREGROUND "https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe" "%CD%/python-3.10.6-amd64.exe"
|
||||
python-3.10.6-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
|
||||
call refreshenv
|
||||
goto :create_venv
|
||||
|
||||
:: Should probably impliment check for pip before installing dependicies
|
||||
:create_venv
|
||||
:: Check if venv already exists
|
||||
dir "%VENV_DIR%\Scripts\Python.exe" -V
|
||||
if %ERRORLEVEL% == 0 goto :ititiate_venv
|
||||
|
||||
:: Otherwise create new venv
|
||||
echo Creating venv in %VENV_DIR%
|
||||
%PYTHON% -m venv "%VENV_DIR%"
|
||||
if %ERRORLEVEL% == 0 goto :ititiate_venv
|
||||
echo Unable to create venv in "%VENV_DIR%"
|
||||
pause
|
||||
|
||||
:ititiate_venv
|
||||
set PYTHON="%VENV_DIR%\Scripts\Python.exe"
|
||||
echo venv %PYTHON%
|
||||
goto :install_depencidies
|
||||
|
||||
:install_depencidies
|
||||
%PYTHON% -m pip install cmake torch numpy sentencepiece %*
|
||||
echo Llama depencidies are now installed!
|
||||
pause
|
Loading…
Add table
Add a link
Reference in a new issue