From 5167f8f0f71d8c3387592c38dfacdef48876ec5e Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sun, 13 Oct 2024 10:21:28 -0700 Subject: [PATCH] refactor: prepare for v1.9.1 - add Nuitka build script for Linux (build_optimized.sh) - update CHANGELOG.md for v1.9.1 - update README.md to match new version and features - improve clarity of CONTRIBUTING.md - sync Windows and Linux build scripts --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ CONTRIBUTING.md | 17 ++++++++--------- README.md | 18 ++++++++++-------- SECURITY.md | 4 ++-- build.sh | 35 +++++++++++------------------------ build_optimized.bat | 2 +- build_optimized.sh | 26 ++++++++++++++++++++++++++ run.sh | 29 +++++++++++++++++++++++++++-- 8 files changed, 114 insertions(+), 46 deletions(-) create mode 100644 build_optimized.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index edf0f17..605663e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## [v1.9.1] - 2024-10-13 + +### Added +- Support for specifying log directory name using AUTOGGUF_LOG_DIR_NAME environment variable +- Work in progress GGUF merge window +- Support for repository types in HF Transfer utility +- New `dequantize_gguf.py` script +- Support for MiniCPM3, RWKVv6, OLMoE, IBM Granite, and Jamba in llama.cpp convert scripts (conversion only) +- Add Nuitka build script for Linux + +### Changed +- Updated Finnish and Russian localizations using Claude 3 Opus +- Improved layout of HF Upload window +- Updated gguf library from upstream +- Refactored code to use localizations for menubar +- Renamed imports_and_globals.py to globals.py +- Moved general functions verify_gguf and process_args to globals.py +- Created Plugins class for extensibility +- Updated dependencies: + - huggingface-hub + - fastapi (~=0.115.0) + - setuptools (~=75.1.0) + - pyside6 (~=6.7.3) + - uvicorn (~=0.31.0) + +### Fixed +- Corrected localization strings and file select types for GGUF merging +- Fix minor errors in build scripts + ## [v1.9.0] - 2024-09-15 ### Added diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1b09444..e2e5deb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,8 +2,6 @@ First off, thanks for taking the time to contribute! 🎉👍 -## How Can I Contribute? - ### Reporting Bugs - Use the issue tracker to report bugs @@ -15,17 +13,18 @@ First off, thanks for taking the time to contribute! 🎉👍 - Use the issue tracker to suggest enhancements - Explain why this enhancement would be useful -### Your First Code Contribution +### Code Contributions You can find issues labeled with "good first issue" in the Issues tab as a starting point. Code refactors and optimizations are also appreciated, although if there's a vulnrability please report it privately in the Security tab. For feature PRs, please make a discussion first to make sure your feature can be added and continously maintained. 1. Fork the repo -2. Create your feature branch (`git checkout -b feature/AmazingFeature`) -3. Install pre-commit: (`pip install pre-commit`) -4. Set up the git hook scripts: (`pre-commit install`) -5. Commit your changes (`git commit -m 'Add some AmazingFeature'`) -6. Push to the branch (`git push origin feature/AmazingFeature`) -7. Open a Pull Request +2. Clone your fork (`git clone https://github.com/your-username/AutoGGUF.git && cd AutoGGUF`) +3. Create your feature branch (`git checkout -b feature/AmazingFeature`) +5. Install pre-commit: (`pip install pre-commit`) +6. Set up the git hook scripts: (`pre-commit install`) +7. Commit your changes (`git commit -m 'Add some AmazingFeature'`) +8. Push to the branch (`git push origin feature/AmazingFeature`) +9. Open a Pull Request on GitHub ## Styleguides diff --git a/README.md b/README.md index 79a25ee..cac5295 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ AutoGGUF provides a graphical user interface for quantizing GGUF models using th - LoRA conversion and merging - Preset saving and loading - AutoFP8 quantization -- GGUF splitting +- GGUF splitting and merging ## Usage @@ -59,9 +59,10 @@ Standard builds: 1. Download the latest release 2. Extract all files to a folder 3. Run `AutoGGUF-x64.exe` +4. Any necessary folders will be automatically created Setup builds: -1. Download setup varient of latest release +1. Download setup variant of latest release 2. Extract all files to a folder 3. Run the setup program 4. The .GGUF extension will be registered with the program automatically @@ -74,8 +75,8 @@ After launching the program, you may access its local server at port 7001 (set ` #### Linux/macOS: ```bash gpg --import AutoGGUF-v1.5.0-prerel.asc -gpg --verify AutoGGUF-v1.5.0-Windows-avx2-prerel.zip.sig AutoGGUF-v1.5.0-Windows-avx2-prerel.zip -sha256sum -c AutoGGUF-v1.5.0-prerel.sha256 +gpg --verify AutoGGUF-v1.9.1-Windows-avx2.zip.sig AutoGGUF-v1.9.1-Windows-avx2.zip +sha256sum -c AutoGGUF-v1.9.1.sha256 ``` #### Windows (PowerShell): @@ -84,11 +85,11 @@ sha256sum -c AutoGGUF-v1.5.0-prerel.sha256 gpg --import AutoGGUF-v1.5.0-prerel.asc # Verify the signature -gpg --verify AutoGGUF-v1.8.1-Windows-avx2.zip.sig AutoGGUF-v1.8.1-Windows-avx2.zip +gpg --verify AutoGGUF-v1.9.1-Windows-avx2.zip.sig AutoGGUF-v1.9.1-Windows-avx2.zip # Check SHA256 -$fileHash = (Get-FileHash -Algorithm SHA256 AutoGGUF-v1.8.1-Windows-avx2.zip).Hash.ToLower() -$storedHash = (Get-Content AutoGGUF-v1.8.1.sha256 | Select-String AutoGGUF-v1.8.1-Windows-avx2.zip).Line.Split()[0] +$fileHash = (Get-FileHash -Algorithm SHA256 AutoGGUF-v1.9.1-Windows-avx2.zip).Hash.ToLower() +$storedHash = (Get-Content AutoGGUF-v1.9.1.sha256 | Select-String AutoGGUF-v1.9.1-Windows-avx2.zip).Line.Split()[0] if ($fileHash -eq $storedHash) { "SHA256 Match" } else { "SHA256 Mismatch" } ``` @@ -106,11 +107,12 @@ cd build//dist/ ### Windows ```bash +pip install -U pyinstaller build RELEASE | DEV ``` Find the executable in `build//dist/AutoGGUF.exe`. -You can also use the slower build but faster executable method (Nuitka): +You can also use Nuitka, which may result in a slower build but a faster output executable: ```bash build_optimized RELEASE | DEV ``` diff --git a/SECURITY.md b/SECURITY.md index 967bb90..d4927ee 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,9 +4,9 @@ | Version | Supported | |-----------------|--------------------| -| stable (v1.9.0) | :white_check_mark: | +| stable (v1.9.x) | :white_check_mark: | -Beta versions are not supported, and may have unknown security issues. +Beta versions are not officially supported and may contain unknown security vulnerabilities. Use them at your own risk. ## Reporting a Vulnerability diff --git a/build.sh b/build.sh index afa2af4..2e2abdc 100644 --- a/build.sh +++ b/build.sh @@ -1,33 +1,20 @@ #!/bin/bash if [ $# -eq 0 ]; then - echo "Usage: $0 [RELEASE|DEV]" + echo "Usage: build.sh [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 [ "${1,,}" = "release" ]; then + echo "Building RELEASE version..." + 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 "Building DEV version..." + 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 "Invalid argument. Use RELEASE or DEV." + exit 1 +fi if [ $? -ne 0 ]; then echo "Build failed." diff --git a/build_optimized.bat b/build_optimized.bat index d1cab2c..c306653 100644 --- a/build_optimized.bat +++ b/build_optimized.bat @@ -1,7 +1,7 @@ @echo off if "%1"=="" ( - echo Usage: build_fast.bat [RELEASE^|DEV] + echo Usage: build_optimized.bat [RELEASE^|DEV] exit /b 1 ) diff --git a/build_optimized.sh b/build_optimized.sh new file mode 100644 index 0000000..791ad9c --- /dev/null +++ b/build_optimized.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Usage: build_fast.sh [RELEASE|DEV]" + exit 1 +fi + +COMMON_FLAGS="--standalone --enable-plugin=pyside6 --include-data-dir=assets=assets" + +if [ "$1" == "RELEASE" ]; then + echo "Building RELEASE version..." + python -m nuitka $COMMON_FLAGS --windows-console-mode=disable --output-dir=build/release src/main.py --lto=yes +elif [ "$1" == "DEV" ]; then + echo "Building DEV version..." + python -m nuitka $COMMON_FLAGS --output-dir=build/dev src/main.py +else + echo "Invalid argument. Use RELEASE or DEV." + exit 1 +fi + +if [ $? -ne 0 ]; then + echo "Build failed." + exit 1 +else + echo "Build completed successfully." +fi diff --git a/run.sh b/run.sh index 5be91aa..fc15868 100644 --- a/run.sh +++ b/run.sh @@ -1,6 +1,31 @@ #!/bin/sh +# Check if Python is installed +if ! command -v python3 >/dev/null 2>&1; then + echo "Error: Python 3 is not installed or not in the PATH." + echo "Please install Python 3 and try again." + exit 1 +fi + +# Set environment variables export PYTHONIOENCODING=utf-8 export AUTOGGUF_LANGUAGE=en-US -export AUTOGGUF_CHECK_BACKEND=disabled -python3 src/main.py \ No newline at end of file + +# Try to run main.py in the current directory +if [ -f "main.py" ]; then + echo "Running main.py in the current directory..." + python3 main.py + exit 0 +fi + +# If main.py doesn't exist in the current directory, try src/main.py +if [ -f "src/main.py" ]; then + echo "Running src/main.py..." + python3 src/main.py + exit 0 +fi + +# If neither file is found, display an error message +echo "Error: Neither main.py nor src/main.py found." +echo "Please make sure the script is in the correct directory." +exit 1