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
This commit is contained in:
BuildTools 2024-10-13 10:21:28 -07:00
parent 7575c97f6a
commit 5167f8f0f7
No known key found for this signature in database
GPG Key ID: 3270C066C15D530B
8 changed files with 114 additions and 46 deletions

View File

@ -1,5 +1,34 @@
# Changelog # 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 ## [v1.9.0] - 2024-09-15
### Added ### Added

View File

@ -2,8 +2,6 @@ # Contributing to AutoGGUF
First off, thanks for taking the time to contribute! 🎉👍 First off, thanks for taking the time to contribute! 🎉👍
## How Can I Contribute?
### Reporting Bugs ### Reporting Bugs
- Use the issue tracker to report bugs - Use the issue tracker to report bugs
@ -15,17 +13,18 @@ ### Suggesting Enhancements
- Use the issue tracker to suggest enhancements - Use the issue tracker to suggest enhancements
- Explain why this enhancement would be useful - 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. 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 1. Fork the repo
2. Create your feature branch (`git checkout -b feature/AmazingFeature`) 2. Clone your fork (`git clone https://github.com/your-username/AutoGGUF.git && cd AutoGGUF`)
3. Install pre-commit: (`pip install pre-commit`) 3. Create your feature branch (`git checkout -b feature/AmazingFeature`)
4. Set up the git hook scripts: (`pre-commit install`) 5. Install pre-commit: (`pip install pre-commit`)
5. Commit your changes (`git commit -m 'Add some AmazingFeature'`) 6. Set up the git hook scripts: (`pre-commit install`)
6. Push to the branch (`git push origin feature/AmazingFeature`) 7. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
7. Open a Pull Request 8. Push to the branch (`git push origin feature/AmazingFeature`)
9. Open a Pull Request on GitHub
## Styleguides ## Styleguides

View File

@ -37,7 +37,7 @@ ## Features
- LoRA conversion and merging - LoRA conversion and merging
- Preset saving and loading - Preset saving and loading
- AutoFP8 quantization - AutoFP8 quantization
- GGUF splitting - GGUF splitting and merging
## Usage ## Usage
@ -59,9 +59,10 @@ ### 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-x64.exe` 3. Run `AutoGGUF-x64.exe`
4. Any necessary folders will be automatically created
Setup builds: Setup builds:
1. Download setup varient of latest release 1. Download setup variant of latest release
2. Extract all files to a folder 2. Extract all files to a folder
3. Run the setup program 3. Run the setup program
4. The .GGUF extension will be registered with the program automatically 4. The .GGUF extension will be registered with the program automatically
@ -74,8 +75,8 @@ ### Verifying Releases
#### Linux/macOS: #### Linux/macOS:
```bash ```bash
gpg --import AutoGGUF-v1.5.0-prerel.asc 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 gpg --verify AutoGGUF-v1.9.1-Windows-avx2.zip.sig AutoGGUF-v1.9.1-Windows-avx2.zip
sha256sum -c AutoGGUF-v1.5.0-prerel.sha256 sha256sum -c AutoGGUF-v1.9.1.sha256
``` ```
#### Windows (PowerShell): #### Windows (PowerShell):
@ -84,11 +85,11 @@ # Import the public key
gpg --import AutoGGUF-v1.5.0-prerel.asc gpg --import AutoGGUF-v1.5.0-prerel.asc
# Verify the signature # 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 # Check SHA256
$fileHash = (Get-FileHash -Algorithm SHA256 AutoGGUF-v1.8.1-Windows-avx2.zip).Hash.ToLower() $fileHash = (Get-FileHash -Algorithm SHA256 AutoGGUF-v1.9.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] $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" } if ($fileHash -eq $storedHash) { "SHA256 Match" } else { "SHA256 Mismatch" }
``` ```
@ -106,11 +107,12 @@ ### Cross-platform
### Windows ### Windows
```bash ```bash
pip install -U pyinstaller
build RELEASE | DEV build RELEASE | DEV
``` ```
Find the executable in `build/<type>/dist/AutoGGUF.exe`. Find the executable in `build/<type>/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 ```bash
build_optimized RELEASE | DEV build_optimized RELEASE | DEV
``` ```

View File

@ -4,9 +4,9 @@ ## Supported Versions
| Version | Supported | | 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 ## Reporting a Vulnerability

View File

@ -1,33 +1,20 @@
#!/bin/bash #!/bin/bash
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
echo "Usage: $0 [RELEASE|DEV]" echo "Usage: build.sh [RELEASE|DEV]"
exit 1 exit 1
fi fi
BUILD_TYPE=$1 if [ "${1,,}" = "release" ]; then
ICON_PATH="../../assets/favicon_large.png" echo "Building RELEASE version..."
ASSETS_PATH="../../assets" 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
SRC_PATH="src/main.py" elif [ "${1,,}" = "dev" ]; then
echo "Building DEV version..."
case $BUILD_TYPE in 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
RELEASE) else
OUTPUT_DIR="build/release" echo "Invalid argument. Use RELEASE or DEV."
EXTRA_ARGS="--windowed"
;;
DEV)
OUTPUT_DIR="build/dev"
EXTRA_ARGS=""
;;
*)
echo "Invalid build type. Use RELEASE or DEV."
exit 1 exit 1
;; fi
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 if [ $? -ne 0 ]; then
echo "Build failed." echo "Build failed."

View File

@ -1,7 +1,7 @@
@echo off @echo off
if "%1"=="" ( if "%1"=="" (
echo Usage: build_fast.bat [RELEASE^|DEV] echo Usage: build_optimized.bat [RELEASE^|DEV]
exit /b 1 exit /b 1
) )

26
build_optimized.sh Normal file
View File

@ -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

27
run.sh
View File

@ -1,6 +1,31 @@
#!/bin/sh #!/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 PYTHONIOENCODING=utf-8
export AUTOGGUF_LANGUAGE=en-US export AUTOGGUF_LANGUAGE=en-US
export AUTOGGUF_CHECK_BACKEND=disabled
# 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 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