mirror of https://github.com/leafspark/AutoGGUF
Add files via upload
This commit is contained in:
parent
108e30f1f9
commit
c6ae2e319c
21
README.md
21
README.md
|
@ -1,29 +1,24 @@
|
||||||
# AutoGGUF - automated GGUF model quantizer
|
AutoGGUF - Automated GGUF Model Quantizer
|
||||||
|
|
||||||
This application provides a graphical user interface for quantizing GGUF models
|
This application provides a graphical user interface for quantizing GGUF models
|
||||||
using the llama.cpp library. It allows users to download different versions of
|
using the llama.cpp library. It allows users to download different versions of
|
||||||
llama.cpp, manage multiple backends, and perform quantization tasks with various
|
llama.cpp, manage multiple backends, and perform quantization tasks with various
|
||||||
options.
|
options.
|
||||||
|
|
||||||
**Main features**:
|
Main features:
|
||||||
1. Download and manage llama.cpp backends
|
1. Download and manage llama.cpp backends
|
||||||
2. Select and quantize GGUF models
|
2. Select and quantize GGUF models
|
||||||
3. Configure quantization parameters
|
3. Configure quantization parameters
|
||||||
4. Monitor system resources during quantization
|
4. Monitor system resources during quantization
|
||||||
|
|
||||||
**Usage**:
|
Usage:
|
||||||
1. Install dependencies, either using the `requirements.txt` file or `pip install PyQt6 requests psutil`.
|
Run the main.py script to start the application.
|
||||||
2. Run the `run.bat` script to start the application, or run the command `python src/main.py`.
|
|
||||||
|
|
||||||
**Dependencies**:
|
Dependencies:
|
||||||
- PyQt6
|
- PyQt6
|
||||||
- requests
|
- requests
|
||||||
- psutil
|
- psutil
|
||||||
|
|
||||||
**To be implemented:**
|
Author: leafspark
|
||||||
- Actual progress bar tracking
|
Version: 1.0.0
|
||||||
- Download safetensors from HF and convert to unquanted GGUF
|
License: apache-2.0
|
||||||
- Specify multiple KV overrides
|
|
||||||
|
|
||||||
**User interface:**
|
|
||||||

|
|
1
run.bat
1
run.bat
|
@ -1,2 +1,3 @@
|
||||||
@echo off
|
@echo off
|
||||||
|
set PYTHONIOENCODING=utf-8
|
||||||
python src/main.py
|
python src/main.py
|
|
@ -531,7 +531,7 @@ def show_task_details(self, item):
|
||||||
|
|
||||||
# Load existing content
|
# Load existing content
|
||||||
if os.path.exists(task_item.log_file):
|
if os.path.exists(task_item.log_file):
|
||||||
with open(task_item.log_file, 'r') as f:
|
with open_file_safe(task_item.log_file, 'r') as f:
|
||||||
log_text.setPlainText(f.read())
|
log_text.setPlainText(f.read())
|
||||||
|
|
||||||
# Connect to the thread if it's still running
|
# Connect to the thread if it's still running
|
||||||
|
|
|
@ -11,7 +11,9 @@
|
||||||
import platform
|
import platform
|
||||||
import requests
|
import requests
|
||||||
import zipfile
|
import zipfile
|
||||||
|
import traceback
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from imports_and_globals import open_file_safe
|
||||||
|
|
||||||
class QuantizationThread(QThread):
|
class QuantizationThread(QThread):
|
||||||
output_signal = pyqtSignal(str)
|
output_signal = pyqtSignal(str)
|
||||||
|
@ -32,7 +34,7 @@ def run(self):
|
||||||
try:
|
try:
|
||||||
self.process = subprocess.Popen(self.command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
self.process = subprocess.Popen(self.command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
||||||
text=True, cwd=self.cwd)
|
text=True, cwd=self.cwd)
|
||||||
with open(self.log_file, 'w') as log:
|
with open_file_safe(self.log_file, 'w') as log:
|
||||||
for line in self.process.stdout:
|
for line in self.process.stdout:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
self.output_signal.emit(line)
|
self.output_signal.emit(line)
|
||||||
|
@ -40,7 +42,6 @@ def run(self):
|
||||||
log.flush()
|
log.flush()
|
||||||
self.status_signal.emit("In Progress")
|
self.status_signal.emit("In Progress")
|
||||||
self.parse_model_info(line)
|
self.parse_model_info(line)
|
||||||
|
|
||||||
self.process.wait()
|
self.process.wait()
|
||||||
if self.process.returncode == 0:
|
if self.process.returncode == 0:
|
||||||
self.status_signal.emit("Completed")
|
self.status_signal.emit("Completed")
|
||||||
|
|
|
@ -19,3 +19,12 @@
|
||||||
def ensure_directory(path):
|
def ensure_directory(path):
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
|
|
||||||
|
def open_file_safe(file_path, mode='r'):
|
||||||
|
encodings = ['utf-8', 'latin-1', 'ascii', 'utf-16']
|
||||||
|
for encoding in encodings:
|
||||||
|
try:
|
||||||
|
return open(file_path, mode, encoding=encoding)
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
continue
|
||||||
|
raise ValueError(f"Unable to open file {file_path} with any of the encodings: {encodings}")
|
Loading…
Reference in New Issue