Open drago87 opened 2 months ago
I have made a .bat file for installing the llama.cpp/gguf-py
and applying the lcpp.patch
then it compiles the llama-quantize binary. All .bat files should be in the
ComfyUI-GGUF/tools folder to work
@echo off
REM Clone the repository
git clone https://github.com/ggerganov/llama.cpp
if %ERRORLEVEL% neq 0 (
echo Git clone failed.
exit /b %ERRORLEVEL%
)
REM Install the required Python package
pip install llama.cpp/gguf-py
if %ERRORLEVEL% neq 0 (
echo Pip install failed.
exit /b %ERRORLEVEL%
)
REM Change to the llama.cpp directory
cd llama.cpp
if not exist llama.cpp (
echo Directory llama.cpp does not exist.
exit /b 1
)
REM Checkout the specified tag
git checkout tags/b3600
if %ERRORLEVEL% neq 0 (
echo Git checkout failed.
exit /b %ERRORLEVEL%
)
REM Apply the patch
git apply ..\lcpp.patch
if %ERRORLEVEL% neq 0 (
echo Git apply patch failed.
exit /b %ERRORLEVEL%
)
REM Create a build directory and navigate into it
mkdir build
cd build
REM Run cmake to configure the build
cmake ..
if %ERRORLEVEL% neq 0 (
echo CMake configuration failed.
exit /b %ERRORLEVEL%
)
REM Build with cmake and compile llama-quantize target
cmake --build . --config Debug -j10 --target llama-quantize
if %ERRORLEVEL% neq 0 (
echo CMake build failed.
exit /b %ERRORLEVEL%
)
echo Build completed successfully.
pause
I have made (with the help of chatGPT) some .bat files to make it easier to convert the models Convert the initial source model (.safetensors file). Just drop the model on the .bat file
quantize your model to Q4_K_S format (Drop the .GGUF file made from the above script onto this .bat file)
Both files need to be in the
\custom_nodes\ComfyUI-GGUF\tools
folderThis is a experimental version of the second script that lets you select the quantize format (The formats was recommended by ChatGPT as i don't know what formats is usable)