mirror of
https://github.com/Pakobbix/StartUI-oobabooga-webui
synced 2025-11-09 18:39:40 +00:00
Compare commits
9 Commits
5e40ae8456
...
86171f84d7
| Author | SHA1 | Date | |
|---|---|---|---|
| 86171f84d7 | |||
| 077669ea2e | |||
| 25087b1e2d | |||
| 5d755a302c | |||
| cc485f5342 | |||
| 20c847a532 | |||
| ab514acc40 | |||
| f28f1f21f9 | |||
| c3696284fa |
5
.github/workflows/package.yml
vendored
5
.github/workflows/package.yml
vendored
@ -28,11 +28,10 @@ jobs:
|
||||
|
||||
- name: Build and package
|
||||
run: |
|
||||
pyinstaller --noconfirm --onefile --windowed StartUI.py
|
||||
cp webuiGUI.py dist/ # Copy webuiGUI.py to the dist directory
|
||||
pyinstaller --noconfirm --onefile --windowed StartUI.py --add-data "${{ github.workspace }}/webuiGUI.py;."
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.os }}-binary-v1.5.1
|
||||
name: ${{ matrix.os }}-binary-v1.6
|
||||
path: dist
|
||||
39
StartUI.py
39
StartUI.py
@ -1,16 +1,17 @@
|
||||
import sys, os, gpustat, json, subprocess, platform, psutil, re, requests, darkdetect, qdarkstyle, time
|
||||
import sys, os, gpustat, json, subprocess, platform, psutil, re, requests, darkdetect, qdarkstyle, time, git
|
||||
from PyQt5.QtWidgets import QApplication, QHBoxLayout, QToolBar, QMessageBox, QAction, QMainWindow, QSpinBox, QLabel, QVBoxLayout, QComboBox, QSlider, QCheckBox, QLineEdit, QFileDialog, QPushButton, QWidget, QListWidget, QListWidgetItem, QGridLayout, QRadioButton, QFrame
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QDoubleValidator, QIntValidator
|
||||
|
||||
# For showing the current version and checking for updates
|
||||
version = "1.5.1"
|
||||
version = "1.6"
|
||||
|
||||
# Profile folder for loading and saving profiles.
|
||||
profiles_folder = "./profiles"
|
||||
# Create the profile folder if it doesn't exist
|
||||
os.makedirs(profiles_folder, exist_ok=True)
|
||||
|
||||
repo_path = "./text-generation-webui"
|
||||
model_folder = "./text-generation-webui/models"
|
||||
extensions_folder = "./text-generation-webui/extensions"
|
||||
loras_folder = "./text-generation-webui/loras"
|
||||
@ -90,6 +91,7 @@ class MainWindow(QMainWindow):
|
||||
super().__init__()
|
||||
|
||||
self.init_ui()
|
||||
self.load_last_commit()
|
||||
self.load_settings()
|
||||
self.set_ram_slider_max()
|
||||
self.update_check()
|
||||
@ -221,6 +223,7 @@ class MainWindow(QMainWindow):
|
||||
# |_| |_|\__,_|_|_| |_| \_/\_/ |_|_| |_|\__,_|\___/ \_/\_/ #
|
||||
# #
|
||||
###################################################################
|
||||
|
||||
layout = QGridLayout()
|
||||
layout.setColumnMinimumWidth(0, 350)
|
||||
layout.setColumnMinimumWidth(3, 30)
|
||||
@ -1905,15 +1908,6 @@ class MainWindow(QMainWindow):
|
||||
def on_update_button_clicked(self):
|
||||
run_cmd_with_conda(f"python {webui_file} --update && exit")
|
||||
|
||||
def load_profile(self, profile_file):
|
||||
with open(profile_file, "r") as file:
|
||||
try:
|
||||
settings = json.load(file)
|
||||
# Set the GUI elements based on the loaded settings...
|
||||
except json.JSONDecodeError:
|
||||
# Handle the case when the file is empty or not in valid JSON format
|
||||
pass
|
||||
|
||||
def populate_profiles_dropdown(self):
|
||||
self.profiles_dropdown.clear()
|
||||
profiles = [name for name in os.listdir(profiles_folder) if name.endswith(".json")]
|
||||
@ -1928,6 +1922,29 @@ class MainWindow(QMainWindow):
|
||||
profile_name = selected_profile.replace(".json", "")
|
||||
self.profile_name_textfield.setText(profile_name)
|
||||
|
||||
def load_last_commit(self):
|
||||
last_commit = os.path.join("./text-generation-webui/.git/ORIG_HEAD")
|
||||
if os.path.exists(last_commit):
|
||||
with open(last_commit, "r") as file:
|
||||
last_commit_sha = file.read()
|
||||
print(last_commit_sha)
|
||||
try:
|
||||
current_commit = (self.get_current_commit_sha() + '\n') # Call the method within the class
|
||||
print(current_commit)
|
||||
if current_commit != last_commit_sha:
|
||||
self.update_button.setVisible(True)
|
||||
else:
|
||||
self.update_button.setVisible(False)
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
|
||||
def get_current_commit_sha(self):
|
||||
# Initialize the Git repository object
|
||||
repo = git.Repo(repo_path)
|
||||
# Get the current commit SHA
|
||||
commit_sha = repo.head.object.hexsha
|
||||
return commit_sha
|
||||
|
||||
def apply_load_settings(self, settings):
|
||||
self.model_dropdown.setCurrentText(settings.get("model", ""))
|
||||
self.model_type.setCurrentText(settings.get("model_type", ""))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user