Update Run_gui.py
Browse files- Run_gui.py +13 -0
Run_gui.py
CHANGED
|
@@ -479,6 +479,7 @@ class CaptionApp(QMainWindow):
|
|
| 479 |
# Checkpoint Path
|
| 480 |
ckpt_layout = QHBoxLayout()
|
| 481 |
self.checkpoint_path_line = QLineEdit()
|
|
|
|
| 482 |
self.checkpoint_path_line.setToolTip("Path to the folder containing model files (clip_model.pt, etc.).")
|
| 483 |
ckpt_layout.addWidget(QLabel("Checkpoint Path:"))
|
| 484 |
ckpt_layout.addWidget(self.checkpoint_path_line)
|
|
@@ -997,6 +998,18 @@ class CaptionApp(QMainWindow):
|
|
| 997 |
self.main_layout = QHBoxLayout(self.central_widget)
|
| 998 |
|
| 999 |
self.initUI() # Call initUI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1000 |
self.update_button_states()
|
| 1001 |
self.apply_theme()
|
| 1002 |
|
|
|
|
| 479 |
# Checkpoint Path
|
| 480 |
ckpt_layout = QHBoxLayout()
|
| 481 |
self.checkpoint_path_line = QLineEdit()
|
| 482 |
+
self.checkpoint_path_line.setText("cgrkzexw-599808")
|
| 483 |
self.checkpoint_path_line.setToolTip("Path to the folder containing model files (clip_model.pt, etc.).")
|
| 484 |
ckpt_layout.addWidget(QLabel("Checkpoint Path:"))
|
| 485 |
ckpt_layout.addWidget(self.checkpoint_path_line)
|
|
|
|
| 998 |
self.main_layout = QHBoxLayout(self.central_widget)
|
| 999 |
|
| 1000 |
self.initUI() # Call initUI
|
| 1001 |
+
|
| 1002 |
+
# Attempt to auto-load models at startup
|
| 1003 |
+
|
| 1004 |
+
if Path("cgrkzexw-599808").exists():
|
| 1005 |
+
try:
|
| 1006 |
+
(self.clip_processor, self.clip_model, self.tokenizer, self.text_model, self.image_adapter) = load_models(Path("cgrkzexw-599808"), status_callback=self.show_status)
|
| 1007 |
+
self.models_loaded = True
|
| 1008 |
+
self.show_status("Models loaded at startup.", 5000)
|
| 1009 |
+
except Exception as e:
|
| 1010 |
+
print("Auto-load failed:", e)
|
| 1011 |
+
self.models_loaded = False
|
| 1012 |
+
|
| 1013 |
self.update_button_states()
|
| 1014 |
self.apply_theme()
|
| 1015 |
|