mirror of
https://github.com/Pakobbix/StartUI-oobabooga-webui
synced 2025-11-09 21:49:39 +00:00
Compare commits
No commits in common. "86171f84d7955e8a3d631002b0e80e1e5181c33f" and "5e40ae8456b8e921e618919795bd3e1c46d20641" have entirely different histories.
86171f84d7
...
5e40ae8456
5
.github/workflows/package.yml
vendored
5
.github/workflows/package.yml
vendored
@ -28,10 +28,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and package
|
- name: Build and package
|
||||||
run: |
|
run: |
|
||||||
pyinstaller --noconfirm --onefile --windowed StartUI.py --add-data "${{ github.workspace }}/webuiGUI.py;."
|
pyinstaller --noconfirm --onefile --windowed StartUI.py
|
||||||
|
cp webuiGUI.py dist/ # Copy webuiGUI.py to the dist directory
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.os }}-binary-v1.6
|
name: ${{ matrix.os }}-binary-v1.5.1
|
||||||
path: dist
|
path: dist
|
||||||
39
StartUI.py
39
StartUI.py
@ -1,17 +1,16 @@
|
|||||||
import sys, os, gpustat, json, subprocess, platform, psutil, re, requests, darkdetect, qdarkstyle, time, git
|
import sys, os, gpustat, json, subprocess, platform, psutil, re, requests, darkdetect, qdarkstyle, time
|
||||||
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.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.QtCore import Qt
|
||||||
from PyQt5.QtGui import QDoubleValidator, QIntValidator
|
from PyQt5.QtGui import QDoubleValidator, QIntValidator
|
||||||
|
|
||||||
# For showing the current version and checking for updates
|
# For showing the current version and checking for updates
|
||||||
version = "1.6"
|
version = "1.5.1"
|
||||||
|
|
||||||
# Profile folder for loading and saving profiles.
|
# Profile folder for loading and saving profiles.
|
||||||
profiles_folder = "./profiles"
|
profiles_folder = "./profiles"
|
||||||
# Create the profile folder if it doesn't exist
|
# Create the profile folder if it doesn't exist
|
||||||
os.makedirs(profiles_folder, exist_ok=True)
|
os.makedirs(profiles_folder, exist_ok=True)
|
||||||
|
|
||||||
repo_path = "./text-generation-webui"
|
|
||||||
model_folder = "./text-generation-webui/models"
|
model_folder = "./text-generation-webui/models"
|
||||||
extensions_folder = "./text-generation-webui/extensions"
|
extensions_folder = "./text-generation-webui/extensions"
|
||||||
loras_folder = "./text-generation-webui/loras"
|
loras_folder = "./text-generation-webui/loras"
|
||||||
@ -91,7 +90,6 @@ class MainWindow(QMainWindow):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
self.init_ui()
|
self.init_ui()
|
||||||
self.load_last_commit()
|
|
||||||
self.load_settings()
|
self.load_settings()
|
||||||
self.set_ram_slider_max()
|
self.set_ram_slider_max()
|
||||||
self.update_check()
|
self.update_check()
|
||||||
@ -223,7 +221,6 @@ class MainWindow(QMainWindow):
|
|||||||
# |_| |_|\__,_|_|_| |_| \_/\_/ |_|_| |_|\__,_|\___/ \_/\_/ #
|
# |_| |_|\__,_|_|_| |_| \_/\_/ |_|_| |_|\__,_|\___/ \_/\_/ #
|
||||||
# #
|
# #
|
||||||
###################################################################
|
###################################################################
|
||||||
|
|
||||||
layout = QGridLayout()
|
layout = QGridLayout()
|
||||||
layout.setColumnMinimumWidth(0, 350)
|
layout.setColumnMinimumWidth(0, 350)
|
||||||
layout.setColumnMinimumWidth(3, 30)
|
layout.setColumnMinimumWidth(3, 30)
|
||||||
@ -1908,6 +1905,15 @@ class MainWindow(QMainWindow):
|
|||||||
def on_update_button_clicked(self):
|
def on_update_button_clicked(self):
|
||||||
run_cmd_with_conda(f"python {webui_file} --update && exit")
|
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):
|
def populate_profiles_dropdown(self):
|
||||||
self.profiles_dropdown.clear()
|
self.profiles_dropdown.clear()
|
||||||
profiles = [name for name in os.listdir(profiles_folder) if name.endswith(".json")]
|
profiles = [name for name in os.listdir(profiles_folder) if name.endswith(".json")]
|
||||||
@ -1922,29 +1928,6 @@ class MainWindow(QMainWindow):
|
|||||||
profile_name = selected_profile.replace(".json", "")
|
profile_name = selected_profile.replace(".json", "")
|
||||||
self.profile_name_textfield.setText(profile_name)
|
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):
|
def apply_load_settings(self, settings):
|
||||||
self.model_dropdown.setCurrentText(settings.get("model", ""))
|
self.model_dropdown.setCurrentText(settings.get("model", ""))
|
||||||
self.model_type.setCurrentText(settings.get("model_type", ""))
|
self.model_type.setCurrentText(settings.get("model_type", ""))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user