@@ -31,7 +31,7 @@ def __init__(self):
31
31
32
32
self .logger .info (INITIALIZING_AUTOGGUF )
33
33
self .setWindowTitle (WINDOW_TITLE )
34
- self .setWindowIcon (QIcon (resource_path ("assets/favicon.ico" )))
34
+ self .setWindowIcon (QIcon (resource_path ("assets/favicon.ico" )))
35
35
self .setGeometry (100 , 100 , 1600 , 1200 )
36
36
37
37
ensure_directory (os .path .abspath ("quantized_models" ))
@@ -171,7 +171,7 @@ def __init__(self):
171
171
"Q5_K_S" ,
172
172
"Q5_K_M" ,
173
173
"Q6_K" ,
174
- "Q8_0" ,
174
+ "Q8_0" ,
175
175
"Q4_0" ,
176
176
"Q4_1" ,
177
177
"Q5_0" ,
@@ -180,7 +180,7 @@ def __init__(self):
180
180
"Q4_0_4_8" ,
181
181
"Q4_0_8_8" ,
182
182
"BF16" ,
183
- "F16" ,
183
+ "F16" ,
184
184
"F32" ,
185
185
"COPY" ,
186
186
]
@@ -452,8 +452,13 @@ def __init__(self):
452
452
# Output Type Dropdown
453
453
self .lora_output_type_combo = QComboBox ()
454
454
self .lora_output_type_combo .addItems (["GGML" , "GGUF" ])
455
- self .lora_output_type_combo .currentIndexChanged .connect (self .update_base_model_visibility )
456
- lora_layout .addRow (self .create_label (OUTPUT_TYPE , SELECT_OUTPUT_TYPE ), self .lora_output_type_combo )
455
+ self .lora_output_type_combo .currentIndexChanged .connect (
456
+ self .update_base_model_visibility
457
+ )
458
+ lora_layout .addRow (
459
+ self .create_label (OUTPUT_TYPE , SELECT_OUTPUT_TYPE ),
460
+ self .lora_output_type_combo ,
461
+ )
457
462
458
463
# Base Model Path (initially hidden)
459
464
self .base_model_label = self .create_label (BASE_MODEL , SELECT_BASE_MODEL_FILE )
@@ -471,7 +476,9 @@ def __init__(self):
471
476
wrapper_layout = QHBoxLayout (self .base_model_wrapper )
472
477
wrapper_layout .addWidget (self .base_model_label )
473
478
wrapper_layout .addWidget (self .base_model_widget , 1 ) # Give it a stretch factor
474
- wrapper_layout .setContentsMargins (0 , 0 , 0 , 0 ) # Remove margins for better alignment
479
+ wrapper_layout .setContentsMargins (
480
+ 0 , 0 , 0 , 0
481
+ ) # Remove margins for better alignment
475
482
476
483
# Add the wrapper to the layout
477
484
lora_layout .addRow (self .base_model_wrapper )
@@ -545,7 +552,7 @@ def __init__(self):
545
552
# Modify the task list to support right-click menu
546
553
self .task_list .setContextMenuPolicy (Qt .ContextMenuPolicy .CustomContextMenu )
547
554
self .task_list .customContextMenuRequested .connect (self .show_task_context_menu )
548
-
555
+
549
556
# Set inital state
550
557
self .update_base_model_visibility (self .lora_output_type_combo .currentIndex ())
551
558
@@ -1200,19 +1207,19 @@ def delete_task(self, item):
1200
1207
if reply == QMessageBox .StandardButton .Yes :
1201
1208
# Retrieve the task_item before removing it from the list
1202
1209
task_item = self .task_list .itemWidget (item )
1203
-
1210
+
1204
1211
# Remove the item from the list
1205
1212
row = self .task_list .row (item )
1206
1213
self .task_list .takeItem (row )
1207
-
1214
+
1208
1215
# If the task is still running, terminate it
1209
1216
if task_item and task_item .log_file :
1210
1217
for thread in self .quant_threads :
1211
1218
if thread .log_file == task_item .log_file :
1212
1219
thread .terminate ()
1213
1220
self .quant_threads .remove (thread )
1214
- break
1215
-
1221
+ break
1222
+
1216
1223
# Delete the task_item widget
1217
1224
if task_item :
1218
1225
task_item .deleteLater ()
@@ -1395,7 +1402,7 @@ def quantize_model(self):
1395
1402
override_string = entry .get_override_string (
1396
1403
model_name = model_name ,
1397
1404
quant_type = quant_type ,
1398
- output_path = output_path
1405
+ output_path = output_path ,
1399
1406
)
1400
1407
if override_string :
1401
1408
command .extend (["--override-kv" , override_string ])
@@ -1413,7 +1420,7 @@ def quantize_model(self):
1413
1420
log_file = os .path .join (
1414
1421
logs_path , f"{ model_name } _{ timestamp } _{ quant_type } .log"
1415
1422
)
1416
-
1423
+
1417
1424
# Log quant command
1418
1425
command_str = " " .join (command )
1419
1426
self .logger .info (f"{ QUANTIZATION_COMMAND } : { command_str } " )
@@ -1430,7 +1437,9 @@ def quantize_model(self):
1430
1437
self .task_list .setItemWidget (list_item , task_item )
1431
1438
1432
1439
# Connect the output signal to the new progress parsing function
1433
- thread .output_signal .connect (lambda line : self .parse_progress (line , task_item ))
1440
+ thread .output_signal .connect (
1441
+ lambda line : self .parse_progress (line , task_item )
1442
+ )
1434
1443
thread .status_signal .connect (task_item .update_status )
1435
1444
thread .finished_signal .connect (lambda : self .task_finished (thread ))
1436
1445
thread .error_signal .connect (lambda err : self .handle_error (err , task_item ))
@@ -1556,7 +1565,7 @@ def generate_imatrix(self):
1556
1565
1557
1566
timestamp = datetime .now ().strftime ("%Y%m%d_%H%M%S" )
1558
1567
log_file = os .path .join (self .logs_input .text (), f"imatrix_{ timestamp } .log" )
1559
-
1568
+
1560
1569
# Log command
1561
1570
command_str = " " .join (command )
1562
1571
self .logger .info (f"{ IMATRIX_GENERATION_COMMAND } : { command_str } " )
@@ -1580,7 +1589,7 @@ def generate_imatrix(self):
1580
1589
except Exception as e :
1581
1590
self .show_error (ERROR_STARTING_IMATRIX_GENERATION .format (str (e )))
1582
1591
self .logger .info (IMATRIX_GENERATION_TASK_STARTED )
1583
-
1592
+
1584
1593
def show_error (self , message ):
1585
1594
self .logger .error (ERROR_MESSAGE .format (message ))
1586
1595
QMessageBox .critical (self , ERROR , message )
@@ -1617,4 +1626,4 @@ def closeEvent(self, event: QCloseEvent):
1617
1626
app = QApplication (sys .argv )
1618
1627
window = AutoGGUF ()
1619
1628
window .show ()
1620
- sys .exit (app .exec ())
1629
+ sys .exit (app .exec ())
0 commit comments