Skip to content

Commit

Permalink
fix: load preset error and LoRA loading
Browse files Browse the repository at this point in the history
- support loading *.gguf file types
- update FAILED_TO_LOAD_PRESET localization key
- remove Save Preset context menu action
  • Loading branch information
leafspark committed Aug 8, 2024
1 parent 11e35a7 commit f5b3b43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
20 changes: 0 additions & 20 deletions src/AutoGGUF.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/localizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"
Expand Down

0 comments on commit f5b3b43

Please sign in to comment.