From 599b3ca1e729212c4e30c73c6ffa04f2d9a01996 Mon Sep 17 00:00:00 2001 From: glencoe2004 Date: Wed, 15 Mar 2023 18:53:24 -0400 Subject: [PATCH] Add files via upload --- Windows-model_conversion.bat | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Windows-model_conversion.bat diff --git a/Windows-model_conversion.bat b/Windows-model_conversion.bat new file mode 100644 index 000000000..e077fbb5d --- /dev/null +++ b/Windows-model_conversion.bat @@ -0,0 +1,31 @@ +@echo off +:: Convert models to 4 bit + +set "VENV_DIR=%~dp0%venv" +set PYTHON="%VENV_DIR%\Scripts\Python.exe" +echo venv is located at: %PYTHON% +goto :convert_ggml + +:: Convert the 7B model to ggml FP16 format +:convert_ggml +%PYTHON% "convert-pth-to-ggml.py" models/7B/ 1 +if %ERRORLEVEL% == 1 goto :fast_quit +goto :build_cmake + +:: Build llama.exe and quantize.exe +:build_cmake +cmake -S . -B build/ -D CMAKE_BUILD_TYPE=Release +cmake --build build/ --config Release +if %ERRORLEVEL% == 1 goto :fast_quit +goto :quantize + +:quantize +.\build\Release\quantize.exe .\models\7B\ggml-model-f16.bin .\models\7B\ggml-model-q4_0.bin 2 +echo All tasks completed successfully. +pause +exit + +:fast_quit +echo Something went wrong! +pause +exit \ No newline at end of file