Skip to content

Commit 6797ba1

Browse files
committedAug 5, 2024
build: add cross-platform build scripts
1 parent 89826de commit 6797ba1

File tree

5 files changed

+293
-106
lines changed

5 files changed

+293
-106
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ __pycache__/
99
!*.bat
1010
!*.txt
1111
!*.md
12+
!*.sh
1213
!LICENSE
1314

1415
# Allow assets folder

‎README.md

+106-106
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,106 @@
1-
![AutoGGUF-banner](https://github.com/user-attachments/assets/0f74b104-0541-46a7-9ac8-4a3fcb74b896)
2-
3-
# AutoGGUF - automated GGUF model quantizer
4-
5-
[![Powered by llama.cpp](https://img.shields.io/badge/Powered%20by-llama.cpp-green.svg)](https://github.com/ggerganov/llama.cpp)
6-
![GitHub release](https://img.shields.io/github/release/leafspark/AutoGGUF.svg)
7-
![GitHub last commit](https://img.shields.io/github/last-commit/leafspark/AutoGGUF.svg)
8-
![GitHub stars](https://img.shields.io/github/stars/leafspark/AutoGGUF.svg)
9-
![GitHub forks](https://img.shields.io/github/forks/leafspark/AutoGGUF.svg)
10-
![GitHub top language](https://img.shields.io/github/languages/top/leafspark/AutoGGUF.svg)
11-
![GitHub repo size](https://img.shields.io/github/repo-size/leafspark/AutoGGUF.svg)
12-
![GitHub license](https://img.shields.io/github/license/leafspark/AutoGGUF.svg)
13-
14-
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.
15-
16-
## Features
17-
18-
- Download and manage llama.cpp backends
19-
- Select and quantize GGUF models
20-
- Configure quantization parameters
21-
- Monitor system resources during quantization
22-
23-
## Usage
24-
25-
### Cross-platform
26-
1. Install dependencies:
27-
```
28-
pip install -r requirements.txt
29-
```
30-
or
31-
```
32-
pip install PyQt6 requests psutil shutil
33-
```
34-
2. Run the application:
35-
```
36-
python src/main.py
37-
```
38-
or use the `run.bat` script.
39-
40-
### Windows
41-
1. Download the latest release
42-
2. Extract all files to a folder
43-
3. Run `AutoGGUF.exe`
44-
45-
## Building
46-
47-
### Cross-platform
48-
```bash
49-
cd src
50-
pip install -U pyinstaller
51-
pyinstaller main.py --onefile
52-
cd dist/main
53-
./main
54-
```
55-
56-
### Windows
57-
```bash
58-
build RELEASE/DEV
59-
```
60-
Find the executable in `build/<type>/dist/AutoGGUF.exe`.
61-
62-
## Dependencies
63-
64-
- PyQt6
65-
- requests
66-
- psutil
67-
- shutil
68-
- OpenSSL
69-
70-
## Localizations
71-
72-
View the list of supported languages at [AutoGGUF/wiki/Installation#configuration](https://github.com/leafspark/AutoGGUF/wiki/Installation#configuration) (LLM translated, except for English).
73-
74-
To use a specific language, set the `AUTOGGUF_LANGUAGE` environment variable to one of the listed language codes.
75-
76-
## Known Issues
77-
78-
- Saving preset while quantizing causes UI thread crash (planned fix: remove this feature)
79-
- Cannot delete task while processing (planned fix: disallow deletion before cancelling or cancel automatically)
80-
- Base Model text still shows when GGML is selected as LoRA type (fix: include text in show/hide Qt layout)
81-
82-
## Planned Features
83-
84-
- Actual progress bar tracking
85-
- Download safetensors from HF and convert to unquantized GGUF
86-
- Perplexity testing
87-
- Managing shards (coming in the next release)
88-
- Time estimation for quantization
89-
- Dynamic values for KV cache (coming in the next release)
90-
- Ability to select and start multiple quants at once (saved in presets, coming in the next release)
91-
92-
## Troubleshooting
93-
94-
- 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`)
95-
96-
## Contributing
97-
98-
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.
99-
100-
## User Interface
101-
102-
![image](https://github.com/user-attachments/assets/2660c841-07ba-4c3f-ae3a-e63c7068bdc1)
103-
104-
## Stargazers
105-
106-
[![Star History Chart](https://api.star-history.com/svg?repos=leafspark/AutoGGUF&type=Date)](https://star-history.com/#leafspark/AutoGGUF&Date)
1+
![AutoGGUF-banner](https://github.com/user-attachments/assets/0f74b104-0541-46a7-9ac8-4a3fcb74b896)
2+
3+
# AutoGGUF - automated GGUF model quantizer
4+
5+
[![Powered by llama.cpp](https://img.shields.io/badge/Powered%20by-llama.cpp-green.svg)](https://github.com/ggerganov/llama.cpp)
6+
![GitHub release](https://img.shields.io/github/release/leafspark/AutoGGUF.svg)
7+
![GitHub last commit](https://img.shields.io/github/last-commit/leafspark/AutoGGUF.svg)
8+
![GitHub stars](https://img.shields.io/github/stars/leafspark/AutoGGUF.svg)
9+
![GitHub forks](https://img.shields.io/github/forks/leafspark/AutoGGUF.svg)
10+
![GitHub top language](https://img.shields.io/github/languages/top/leafspark/AutoGGUF.svg)
11+
![GitHub repo size](https://img.shields.io/github/repo-size/leafspark/AutoGGUF.svg)
12+
![GitHub license](https://img.shields.io/github/license/leafspark/AutoGGUF.svg)
13+
14+
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.
15+
16+
## Features
17+
18+
- Download and manage llama.cpp backends
19+
- Select and quantize GGUF models
20+
- Configure quantization parameters
21+
- Monitor system resources during quantization
22+
23+
## Usage
24+
25+
### Cross-platform
26+
1. Install dependencies:
27+
```
28+
pip install -r requirements.txt
29+
```
30+
or
31+
```
32+
pip install PyQt6 requests psutil shutil
33+
```
34+
2. Run the application:
35+
```
36+
python src/main.py
37+
```
38+
or use the `run.bat` script.
39+
40+
### Windows
41+
1. Download the latest release
42+
2. Extract all files to a folder
43+
3. Run `AutoGGUF.exe`
44+
45+
## Building
46+
47+
### Cross-platform
48+
```bash
49+
cd src
50+
pip install -U pyinstaller
51+
pyinstaller main.py --onefile
52+
cd dist/main
53+
./main
54+
```
55+
56+
### Windows
57+
```bash
58+
build RELEASE/DEV
59+
```
60+
Find the executable in `build/<type>/dist/AutoGGUF.exe`.
61+
62+
## Dependencies
63+
64+
- PyQt6
65+
- requests
66+
- psutil
67+
- shutil
68+
- OpenSSL
69+
70+
## Localizations
71+
72+
View the list of supported languages at [AutoGGUF/wiki/Installation#configuration](https://github.com/leafspark/AutoGGUF/wiki/Installation#configuration) (LLM translated, except for English).
73+
74+
To use a specific language, set the `AUTOGGUF_LANGUAGE` environment variable to one of the listed language codes.
75+
76+
## Known Issues
77+
78+
- Saving preset while quantizing causes UI thread crash (planned fix: remove this feature)
79+
- Cannot delete task while processing (planned fix: disallow deletion before cancelling or cancel automatically)
80+
- Base Model text still shows when GGML is selected as LoRA type (fix: include text in show/hide Qt layout)
81+
82+
## Planned Features
83+
84+
- Actual progress bar tracking
85+
- Download safetensors from HF and convert to unquantized GGUF
86+
- Perplexity testing
87+
- Managing shards (coming in the next release)
88+
- Time estimation for quantization
89+
- Dynamic values for KV cache (coming in the next release)
90+
- Ability to select and start multiple quants at once (saved in presets, coming in the next release)
91+
92+
## Troubleshooting
93+
94+
- 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`)
95+
96+
## Contributing
97+
98+
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.
99+
100+
## User Interface
101+
102+
![image](https://github.com/user-attachments/assets/2660c841-07ba-4c3f-ae3a-e63c7068bdc1)
103+
104+
## Stargazers
105+
106+
[![Star History Chart](https://api.star-history.com/svg?repos=leafspark/AutoGGUF&type=Date)](https://star-history.com/#leafspark/AutoGGUF&Date)

‎build.sh

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
if [ $# -eq 0 ]; then
4+
echo "Usage: $0 [RELEASE|DEV]"
5+
exit 1
6+
fi
7+
8+
BUILD_TYPE=$1
9+
ICON_PATH="../../assets/favicon_large.png"
10+
ASSETS_PATH="../../assets"
11+
SRC_PATH="src/main.py"
12+
13+
case $BUILD_TYPE in
14+
RELEASE)
15+
OUTPUT_DIR="build/release"
16+
EXTRA_ARGS="--windowed"
17+
;;
18+
DEV)
19+
OUTPUT_DIR="build/dev"
20+
EXTRA_ARGS=""
21+
;;
22+
*)
23+
echo "Invalid build type. Use RELEASE or DEV."
24+
exit 1
25+
;;
26+
esac
27+
28+
echo "Building $BUILD_TYPE version..."
29+
30+
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
31+
32+
if [ $? -ne 0 ]; then
33+
echo "Build failed."
34+
exit 1
35+
else
36+
echo "Build completed successfully."
37+
fi

‎build_nfo.bat

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
@echo off
2+
cls
3+
echo.
4+
echo . .
5+
echo . ^| .
6+
echo . . . .
7+
echo . . ^|. ^|.. .
8+
echo . ^| ^| ^| .
9+
echo . ^| ^| ^| ^| ^| .
10+
echo ." ^|...^| ."
11+
echo ." ." ^| ^|.
12+
echo ." ." ^| ^| .
13+
echo ." ." ^| ."
14+
echo ." ." ."
15+
echo ____." ." ."
16+
echo ." ."
17+
echo ." ."
18+
echo ." ." AutoGGUF Builder v1.337
19+
echo ." ." ~~~ Cracked by CODEX Team ~~~
20+
echo ."."
21+
echo ."."
22+
echo "."
23+
echo.
24+
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
25+
echo : Release Notes :
26+
echo : - Now with 100%% less Python dependency! :
27+
echo : - Added quantum entanglement for faster builds :
28+
echo : - Integrated AI to write better code than you :
29+
echo : - Free pizza with every successful compile (while stocks last) :
30+
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
31+
echo : Installation :
32+
echo : 1. Run this totally legit .bat file :
33+
echo : 2. Choose your poison: RELEASE or DEV :
34+
echo : 3. ??? :
35+
echo : 4. Profit! :
36+
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
37+
echo : System Requirements :
38+
echo : - A computer (duh) :
39+
echo : - Electricity (optional but recommended) :
40+
echo : - At least 3 brain cells :
41+
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
42+
echo.
43+
44+
if "%1"=="" (
45+
echo [!] ERROR: No build type specified. RTFM, n00b!
46+
echo Usage: build.bat [RELEASE^|DEV]
47+
exit /b 1
48+
)
49+
50+
if /I "%1"=="RELEASE" (
51+
echo [+] Initiating RELEASE build sequence...
52+
echo [+] Compressing code until it becomes a singularity...
53+
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
54+
) else if /I "%1"=="DEV" (
55+
echo [+] Launching DEV build missiles...
56+
echo [+] Obfuscating code to confuse even its creator...
57+
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
58+
) else (
59+
echo [!] FATAL ERROR: Invalid build type. Are you even trying?
60+
echo Use RELEASE or DEV, genius.
61+
exit /b 1
62+
)
63+
64+
if errorlevel 1 (
65+
echo [-] Build failed. Blame the intern.
66+
exit /b 1
67+
) else (
68+
echo [+] Build completed successfully. Time to take credit for someone else's work!
69+
)
70+
71+
echo.
72+
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
73+
echo : Remember: Piracy is wrong. Unless you're really good at it. :
74+
echo +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

0 commit comments

Comments
 (0)