build: add cross-platform build scripts

This commit is contained in:
BuildTools 2024-08-04 19:04:02 -07:00
parent 89826de0b2
commit 6797ba1110
5 changed files with 293 additions and 106 deletions

1
.gitignore vendored
View File

@ -9,6 +9,7 @@ __pycache__/
!*.bat !*.bat
!*.txt !*.txt
!*.md !*.md
!*.sh
!LICENSE !LICENSE
# Allow assets folder # Allow assets folder

212
README.md
View File

@ -1,106 +1,106 @@
![AutoGGUF-banner](https://github.com/user-attachments/assets/0f74b104-0541-46a7-9ac8-4a3fcb74b896) ![AutoGGUF-banner](https://github.com/user-attachments/assets/0f74b104-0541-46a7-9ac8-4a3fcb74b896)
# AutoGGUF - automated GGUF model quantizer # AutoGGUF - automated GGUF model quantizer
[![Powered by llama.cpp](https://img.shields.io/badge/Powered%20by-llama.cpp-green.svg)](https://github.com/ggerganov/llama.cpp) [![Powered by llama.cpp](https://img.shields.io/badge/Powered%20by-llama.cpp-green.svg)](https://github.com/ggerganov/llama.cpp)
![GitHub release](https://img.shields.io/github/release/leafspark/AutoGGUF.svg) ![GitHub release](https://img.shields.io/github/release/leafspark/AutoGGUF.svg)
![GitHub last commit](https://img.shields.io/github/last-commit/leafspark/AutoGGUF.svg) ![GitHub last commit](https://img.shields.io/github/last-commit/leafspark/AutoGGUF.svg)
![GitHub stars](https://img.shields.io/github/stars/leafspark/AutoGGUF.svg) ![GitHub stars](https://img.shields.io/github/stars/leafspark/AutoGGUF.svg)
![GitHub forks](https://img.shields.io/github/forks/leafspark/AutoGGUF.svg) ![GitHub forks](https://img.shields.io/github/forks/leafspark/AutoGGUF.svg)
![GitHub top language](https://img.shields.io/github/languages/top/leafspark/AutoGGUF.svg) ![GitHub top language](https://img.shields.io/github/languages/top/leafspark/AutoGGUF.svg)
![GitHub repo size](https://img.shields.io/github/repo-size/leafspark/AutoGGUF.svg) ![GitHub repo size](https://img.shields.io/github/repo-size/leafspark/AutoGGUF.svg)
![GitHub license](https://img.shields.io/github/license/leafspark/AutoGGUF.svg) ![GitHub license](https://img.shields.io/github/license/leafspark/AutoGGUF.svg)
AutoGGUF provides a graphical user interface for quantizing GGUF models using the llama.cpp library. It allows users to download different versions of llama.cpp, manage multiple backends, and perform quantization tasks with various options. AutoGGUF provides a graphical user interface for quantizing GGUF models using the llama.cpp library. It allows users to download different versions of llama.cpp, manage multiple backends, and perform quantization tasks with various options.
## Features ## Features
- Download and manage llama.cpp backends - Download and manage llama.cpp backends
- Select and quantize GGUF models - Select and quantize GGUF models
- Configure quantization parameters - Configure quantization parameters
- Monitor system resources during quantization - Monitor system resources during quantization
## Usage ## Usage
### Cross-platform ### Cross-platform
1. Install dependencies: 1. Install dependencies:
``` ```
pip install -r requirements.txt pip install -r requirements.txt
``` ```
or or
``` ```
pip install PyQt6 requests psutil shutil pip install PyQt6 requests psutil shutil
``` ```
2. Run the application: 2. Run the application:
``` ```
python src/main.py python src/main.py
``` ```
or use the `run.bat` script. or use the `run.bat` script.
### Windows ### Windows
1. Download the latest release 1. Download the latest release
2. Extract all files to a folder 2. Extract all files to a folder
3. Run `AutoGGUF.exe` 3. Run `AutoGGUF.exe`
## Building ## Building
### Cross-platform ### Cross-platform
```bash ```bash
cd src cd src
pip install -U pyinstaller pip install -U pyinstaller
pyinstaller main.py --onefile pyinstaller main.py --onefile
cd dist/main cd dist/main
./main ./main
``` ```
### Windows ### Windows
```bash ```bash
build RELEASE/DEV build RELEASE/DEV
``` ```
Find the executable in `build/<type>/dist/AutoGGUF.exe`. Find the executable in `build/<type>/dist/AutoGGUF.exe`.
## Dependencies ## Dependencies
- PyQt6 - PyQt6
- requests - requests
- psutil - psutil
- shutil - shutil
- OpenSSL - OpenSSL
## Localizations ## Localizations
View the list of supported languages at [AutoGGUF/wiki/Installation#configuration](https://github.com/leafspark/AutoGGUF/wiki/Installation#configuration) (LLM translated, except for English). View the list of supported languages at [AutoGGUF/wiki/Installation#configuration](https://github.com/leafspark/AutoGGUF/wiki/Installation#configuration) (LLM translated, except for English).
To use a specific language, set the `AUTOGGUF_LANGUAGE` environment variable to one of the listed language codes. To use a specific language, set the `AUTOGGUF_LANGUAGE` environment variable to one of the listed language codes.
## Known Issues ## Known Issues
- Saving preset while quantizing causes UI thread crash (planned fix: remove this feature) - Saving preset while quantizing causes UI thread crash (planned fix: remove this feature)
- Cannot delete task while processing (planned fix: disallow deletion before cancelling or cancel automatically) - Cannot delete task while processing (planned fix: disallow deletion before cancelling or cancel automatically)
- Base Model text still shows when GGML is selected as LoRA type (fix: include text in show/hide Qt layout) - Base Model text still shows when GGML is selected as LoRA type (fix: include text in show/hide Qt layout)
## Planned Features ## Planned Features
- Actual progress bar tracking - Actual progress bar tracking
- Download safetensors from HF and convert to unquantized GGUF - Download safetensors from HF and convert to unquantized GGUF
- Perplexity testing - Perplexity testing
- Managing shards (coming in the next release) - Managing shards (coming in the next release)
- Time estimation for quantization - Time estimation for quantization
- Dynamic values for KV cache (coming in the next release) - Dynamic values for KV cache (coming in the next release)
- Ability to select and start multiple quants at once (saved in presets, coming in the next release) - Ability to select and start multiple quants at once (saved in presets, coming in the next release)
## Troubleshooting ## Troubleshooting
- SSL module cannot be found error: Install OpenSSL or run from source using `python src/main.py` with the `run.bat` script (`pip install requests`) - SSL module cannot be found error: Install OpenSSL or run from source using `python src/main.py` with the `run.bat` script (`pip install requests`)
## Contributing ## Contributing
Fork the repo, make your changes, and ensure you have the latest commits when merging. Include a changelog of new features in your pull request description. Fork the repo, make your changes, and ensure you have the latest commits when merging. Include a changelog of new features in your pull request description.
## User Interface ## User Interface
![image](https://github.com/user-attachments/assets/2660c841-07ba-4c3f-ae3a-e63c7068bdc1) ![image](https://github.com/user-attachments/assets/2660c841-07ba-4c3f-ae3a-e63c7068bdc1)
## Stargazers ## Stargazers
[![Star History Chart](https://api.star-history.com/svg?repos=leafspark/AutoGGUF&type=Date)](https://star-history.com/#leafspark/AutoGGUF&Date) [![Star History Chart](https://api.star-history.com/svg?repos=leafspark/AutoGGUF&type=Date)](https://star-history.com/#leafspark/AutoGGUF&Date)

37
build.sh Normal file
View File

@ -0,0 +1,37 @@
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: $0 [RELEASE|DEV]"
exit 1
fi
BUILD_TYPE=$1
ICON_PATH="../../assets/favicon_large.png"
ASSETS_PATH="../../assets"
SRC_PATH="src/main.py"
case $BUILD_TYPE in
RELEASE)
OUTPUT_DIR="build/release"
EXTRA_ARGS="--windowed"
;;
DEV)
OUTPUT_DIR="build/dev"
EXTRA_ARGS=""
;;
*)
echo "Invalid build type. Use RELEASE or DEV."
exit 1
;;
esac
echo "Building $BUILD_TYPE version..."
pyinstaller $EXTRA_ARGS --onefile --name=AutoGGUF --icon=$ICON_PATH --add-data "$ASSETS_PATH:assets" --distpath=$OUTPUT_DIR/dist --workpath=$OUTPUT_DIR/build --specpath=$OUTPUT_DIR $SRC_PATH
if [ $? -ne 0 ]; then
echo "Build failed."
exit 1
else
echo "Build completed successfully."
fi

74
build_nfo.bat Normal file
View File

@ -0,0 +1,74 @@
@echo off
cls
echo.
echo . .
echo . ^| .
echo . . . .
echo . . ^|. ^|.. .
echo . ^| ^| ^| .
echo . ^| ^| ^| ^| ^| .
echo ." ^|...^| ."
echo ." ." ^| ^|.
echo ." ." ^| ^| .
echo ." ." ^| ."
echo ." ." ."
echo ____." ." ."
echo ." ."
echo ." ."
echo ." ." AutoGGUF Builder v1.337
echo ." ." ~~~ Cracked by CODEX Team ~~~
echo ."."
echo ."."
echo "."
echo.
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
echo : Release Notes :
echo : - Now with 100%% less Python dependency! :
echo : - Added quantum entanglement for faster builds :
echo : - Integrated AI to write better code than you :
echo : - Free pizza with every successful compile (while stocks last) :
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
echo : Installation :
echo : 1. Run this totally legit .bat file :
echo : 2. Choose your poison: RELEASE or DEV :
echo : 3. ??? :
echo : 4. Profit! :
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
echo : System Requirements :
echo : - A computer (duh) :
echo : - Electricity (optional but recommended) :
echo : - At least 3 brain cells :
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
echo.
if "%1"=="" (
echo [!] ERROR: No build type specified. RTFM, n00b!
echo Usage: build.bat [RELEASE^|DEV]
exit /b 1
)
if /I "%1"=="RELEASE" (
echo [+] Initiating RELEASE build sequence...
echo [+] Compressing code until it becomes a singularity...
pyinstaller --windowed --onefile --name=AutoGGUF --icon=../../assets/favicon_large.png --add-data "../../assets;assets" --distpath=build\release\dist --workpath=build\release\build --specpath=build\release src\main.py
) else if /I "%1"=="DEV" (
echo [+] Launching DEV build missiles...
echo [+] Obfuscating code to confuse even its creator...
pyinstaller --onefile --name=AutoGGUF --icon=../../assets/favicon_large.png --add-data "../../assets;assets" --distpath=build\dev\dist --workpath=build\dev\build --specpath=build\dev src\main.py
) else (
echo [!] FATAL ERROR: Invalid build type. Are you even trying?
echo Use RELEASE or DEV, genius.
exit /b 1
)
if errorlevel 1 (
echo [-] Build failed. Blame the intern.
exit /b 1
) else (
echo [+] Build completed successfully. Time to take credit for someone else's work!
)
echo.
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
echo : Remember: Piracy is wrong. Unless you're really good at it. :
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

75
build_nfo.sh Normal file
View File

@ -0,0 +1,75 @@
#!/bin/bash
clear
echo ""
echo " . ."
echo " . | ."
echo " . . . ."
echo " . . |. |.. ."
echo " . | | | ."
echo " . | | | | | ."
echo " .\" |...| .\""
echo " .\" .\" | |."
echo " .\" .\" | | ."
echo " .\" .\" | .\""
echo " .\" .\" .\""
echo "______.\" .\" .\""
echo " .\" .\""
echo " .\" .\""
echo " .\" .\" AutoGGUF Builder v1.337"
echo " .\" .\" ~~~ Cracked by CODEX Team ~~~"
echo " .\".\" "
echo " .\".\" "
echo ".\". "
echo ""
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo ": Release Notes :"
echo ": - Now with 100% less Python dependency! :"
echo ": - Added quantum entanglement for faster builds :"
echo ": - Integrated AI to write better code than you :"
echo ": - Free pizza with every successful compile (while stocks last) :"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo ": Installation :"
echo ": 1. Run this totally legit .sh file :"
echo ": 2. Choose your poison: RELEASE or DEV :"
echo ": 3. ??? :"
echo ": 4. Profit! :"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo ": System Requirements :"
echo ": - A computer (duh) :"
echo ": - Electricity (optional but recommended) :"
echo ": - At least 3 brain cells :"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo ""
if [ $# -eq 0 ]; then
echo "[!] ERROR: No build type specified. RTFM, n00b!"
echo " Usage: $0 [RELEASE|DEV]"
exit 1
fi
if [ "$1" = "RELEASE" ]; then
echo "[+] Initiating RELEASE build sequence..."
echo "[+] Compressing code until it becomes a singularity..."
pyinstaller --windowed --onefile --name=AutoGGUF --icon=../../assets/favicon_large.png --add-data "../../assets:assets" --distpath=build/release/dist --workpath=build/release/build --specpath=build/release src/main.py
elif [ "$1" = "DEV" ]; then
echo "[+] Launching DEV build missiles..."
echo "[+] Obfuscating code to confuse even its creator..."
pyinstaller --onefile --name=AutoGGUF --icon=../../assets/favicon_large.png --add-data "../../assets:assets" --distpath=build/dev/dist --workpath=build/dev/build --specpath=build/dev src/main.py
else
echo "[!] FATAL ERROR: Invalid build type. Are you even trying?"
echo " Use RELEASE or DEV, genius."
exit 1
fi
if [ $? -ne 0 ]; then
echo "[-] Build failed. Blame the intern."
exit 1
else
echo "[+] Build completed successfully. Time to take credit for someone else's work!"
fi
echo ""
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
echo ": Remember: Piracy is wrong. Unless you're really good at it. :"
echo "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"