mirror of https://github.com/leafspark/AutoGGUF
fix: load preset error and LoRA loading
- support loading *.gguf file types - update FAILED_TO_LOAD_PRESET localization key - remove Save Preset context menu action
This commit is contained in:
parent
11e35a7535
commit
f5b3b43d01
|
@ -20,19 +20,6 @@
|
|||
from imports_and_globals import ensure_directory, open_file_safe, resource_path
|
||||
from localizations import *
|
||||
|
||||
from functools import wraps
|
||||
|
||||
|
||||
def handle_load_preset_error(func):
|
||||
@wraps(func)
|
||||
def wrapper(self, *args, **kwargs):
|
||||
try:
|
||||
return func(self, *args, **kwargs)
|
||||
except Exception as e:
|
||||
QMessageBox.critical(self, ERROR, FAILED_TO_LOAD_PRESET.format(str(e)))
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
class AutoGGUF(QMainWindow):
|
||||
def __init__(self):
|
||||
|
@ -724,7 +711,6 @@ def save_preset(self):
|
|||
)
|
||||
self.logger.info(PRESET_SAVED_TO.format(file_name))
|
||||
|
||||
@handle_load_preset_error
|
||||
def load_preset(self):
|
||||
self.logger.info(LOADING_PRESET)
|
||||
file_name, _ = QFileDialog.getOpenFileName(self, LOAD_PRESET, "", JSON_FILES)
|
||||
|
@ -1332,12 +1318,6 @@ def show_task_context_menu(self, position):
|
|||
restart_action.triggered.connect(lambda: self.restart_task(task_item))
|
||||
context_menu.addAction(restart_action)
|
||||
|
||||
save_preset_action = QAction(SAVE_PRESET, self)
|
||||
save_preset_action.triggered.connect(
|
||||
lambda: self.save_task_preset(task_item)
|
||||
)
|
||||
context_menu.addAction(save_preset_action)
|
||||
|
||||
delete_action = QAction(DELETE, self)
|
||||
delete_action.triggered.connect(lambda: self.delete_task(item))
|
||||
context_menu.addAction(delete_action)
|
||||
|
|
|
@ -132,7 +132,7 @@ def __init__(self):
|
|||
self.DAT_FILES = "DAT Files (*.dat)"
|
||||
self.JSON_FILES = "JSON Files (*.json)"
|
||||
self.BIN_FILES = "Binary Files (*.bin)"
|
||||
self.LORA_FILES = "LoRA Files (*.bin)"
|
||||
self.LORA_FILES = "LoRA Files (*.bin *.gguf)"
|
||||
self.GGUF_AND_BIN_FILES = "GGUF and Binary Files (*.gguf *.bin)"
|
||||
self.SHARDED = "sharded"
|
||||
|
||||
|
@ -157,7 +157,7 @@ def __init__(self):
|
|||
self.ERROR_FETCHING_RELEASES = "Error fetching releases: {0}"
|
||||
self.CONFIRM_DELETION_TITLE = "Confirm Deletion"
|
||||
self.LOG_FOR = "Log for {0}"
|
||||
self.FAILED_LOAD_PRESET = "Failed to load preset: {0}"
|
||||
self.FAILED_TO_LOAD_PRESET = "Failed to load preset: {0}"
|
||||
self.INITIALIZING_AUTOGGUF = "Initializing AutoGGUF application"
|
||||
self.AUTOGGUF_INITIALIZATION_COMPLETE = "AutoGGUF initialization complete"
|
||||
self.REFRESHING_BACKENDS = "Refreshing backends"
|
||||
|
|
Loading…
Reference in New Issue