Skip to content

Commit

Permalink
refactor: use localization keys for HF conversion
Browse files Browse the repository at this point in the history
- reduce base class length
- reorganize English, French, and Simplified Chinese
  • Loading branch information
leafspark committed Aug 6, 2024
1 parent c063593 commit 6070aac
Show file tree
Hide file tree
Showing 2 changed files with 505 additions and 576 deletions.
8 changes: 4 additions & 4 deletions src/AutoGGUF.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,15 +837,15 @@ def delete_lora_adapter_item(self, adapter_widget):
break

def browse_hf_model_input(self):
self.logger.info("Browsing for HuggingFace model directory")
self.logger.info(BROWSE_FOR_HF_MODEL_DIRECTORY)
model_dir = QFileDialog.getExistingDirectory(self, SELECT_HF_MODEL_DIRECTORY)
if model_dir:
self.hf_model_input.setText(os.path.abspath(model_dir))

def browse_hf_outfile(self):
self.logger.info("Browsing for HuggingFace to GGUF output file")
self.logger.info(BROWSE_FOR_HF_TO_GGUF_OUTPUT)
outfile, _ = QFileDialog.getSaveFileName(
self, "Select Output File", "", "GGUF Files (*.gguf)"
self, SELECT_OUTPUT_FILE, "", GGUF_FILES
)
if outfile:
self.hf_outfile.setText(os.path.abspath(outfile))
Expand Down Expand Up @@ -1425,7 +1425,7 @@ def load_models(self):
# Add sharded models
for base_name, shards in sharded_models.items():
parent_item = QTreeWidgetItem(self.model_tree)
parent_item.setText(0, f"{base_name} (sharded)")
parent_item.setText(0, f"{base_name} ({SHARDED})")
# Sort shards by shard number and get the first one
first_shard = sorted(shards, key=lambda x: x[0])[0][1]
parent_item.setData(0, Qt.ItemDataRole.UserRole, first_shard)
Expand Down
Loading

0 comments on commit 6070aac

Please sign in to comment.