mirror of https://github.com/leafspark/AutoGGUF
refactor: use localization keys for HF conversion
- reduce base class length - reorganize English, French, and Simplified Chinese
This commit is contained in:
parent
c0635936cc
commit
6070aac200
|
@ -837,15 +837,15 @@ def delete_lora_adapter_item(self, adapter_widget):
|
||||||
break
|
break
|
||||||
|
|
||||||
def browse_hf_model_input(self):
|
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)
|
model_dir = QFileDialog.getExistingDirectory(self, SELECT_HF_MODEL_DIRECTORY)
|
||||||
if model_dir:
|
if model_dir:
|
||||||
self.hf_model_input.setText(os.path.abspath(model_dir))
|
self.hf_model_input.setText(os.path.abspath(model_dir))
|
||||||
|
|
||||||
def browse_hf_outfile(self):
|
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(
|
outfile, _ = QFileDialog.getSaveFileName(
|
||||||
self, "Select Output File", "", "GGUF Files (*.gguf)"
|
self, SELECT_OUTPUT_FILE, "", GGUF_FILES
|
||||||
)
|
)
|
||||||
if outfile:
|
if outfile:
|
||||||
self.hf_outfile.setText(os.path.abspath(outfile))
|
self.hf_outfile.setText(os.path.abspath(outfile))
|
||||||
|
@ -1425,7 +1425,7 @@ def load_models(self):
|
||||||
# Add sharded models
|
# Add sharded models
|
||||||
for base_name, shards in sharded_models.items():
|
for base_name, shards in sharded_models.items():
|
||||||
parent_item = QTreeWidgetItem(self.model_tree)
|
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
|
# Sort shards by shard number and get the first one
|
||||||
first_shard = sorted(shards, key=lambda x: x[0])[0][1]
|
first_shard = sorted(shards, key=lambda x: x[0])[0][1]
|
||||||
parent_item.setData(0, Qt.ItemDataRole.UserRole, first_shard)
|
parent_item.setData(0, Qt.ItemDataRole.UserRole, first_shard)
|
||||||
|
|
1073
src/localizations.py
1073
src/localizations.py
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue