From b0d8078c499a97636ab0aa8f0bf3ff098c253965 Mon Sep 17 00:00:00 2001 From: arroyoquiel <81461845+arroyoquiel@users.noreply.github.com> Date: Sun, 9 Apr 2023 05:01:16 -0600 Subject: [PATCH] Changed Git and Conversion Changed the Git install so it doesn't exit if you pressed no if you already had it installed. Changed the conversion: It asks to convert a model. If user agrees, it converts using Python. If not, it skips. On conversion failure, it reverts to original model. Removed some testing pauses and added some echo. for easier readability. --- install.bat | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/install.bat b/install.bat index 31cda32c..cd102bab 100644 --- a/install.bat +++ b/install.bat @@ -172,6 +172,7 @@ goto :CONTINUE echo. REM Install Git +echo. choice /C YN /M "Do you want to download and install Git?" if errorlevel 2 goto GIT_CANCEL if errorlevel 1 goto GIT_CHECK @@ -185,8 +186,10 @@ REM Install Git echo "Checking for git..." where git >nul 2>&1 if %ERRORLEVEL% EQU 0 ( + echo. echo "Git is installed." ) else ( + echo. echo "Git is not installed. Installing Git..." powershell.exe -Command "Start-Process https://git-scm.com/download/win -Wait" ) @@ -213,26 +216,28 @@ REM Prompt user to choose a model to convert set /P modelNumber="Enter the number of the model you want to convert: " if not defined file[%modelNumber%] ( + echo. echo Invalid option. Restarting... goto CONVERT_RESTART ) set "modelPath=!file[%modelNumber%]!" +echo. echo You selected !modelPath! REM Ask user if they want to convert the model choice /C YN /M "Do you want to convert the selected model to the new format?" if errorlevel 2 ( + echo. echo Model conversion cancelled. Skipping... goto END ) REM Convert the model +echo. echo Converting the model to the new format... if not exist tmp\llama.cpp git clone https://github.com/ggerganov/llama.cpp.git tmp\llama.cpp move /y "!modelPath!" "!modelPath!.original" python tmp\llama.cpp\migrate-ggml-2023-03-30-pr613.py "!modelPath!.original" "!modelPath!" -echo %errorlevel% -pause if %errorlevel% neq 0 ( goto ERROR_CONVERSION ) else ( @@ -240,16 +245,19 @@ if %errorlevel% neq 0 ( ) :ERROR_CONVERSION +echo. echo Error during model conversion. Restarting... move /y "!modelPath!.original" "!modelPath!" goto CONVERT_RESTART :SUCCESSFUL_CONVERSION +echo. echo The model file (!modelPath!) has been converted to the new format. goto END pause :CANCEL_CONVERSION +echo. echo Conversion cancelled. Skipping... goto END