Skip to content

Commit

Permalink
refactor: Switch from PyQt6 to PySide6 for license compatibility
Browse files Browse the repository at this point in the history
- Replaced all PyQt6 imports with PySide6
- Updated signal syntax (pyqtSignal to Signal)
- Modified requirements.txt to use PySide6
- Ensured compatibility with Apache-2.0 license
  • Loading branch information
leafspark committed Aug 8, 2024
1 parent 260d4cd commit 7e61f6b
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 56 deletions.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PyQt6~=6.7.1
psutil~=5.9.8
requests~=2.32.3
numpy<2.0.0
torch~=1.13.1
sentencepiece~=0.2.0
PyYAML~=6.0.2
pynvml~=11.5.3
pynvml~=11.5.3
PySide6~=6.7.2
6 changes: 3 additions & 3 deletions src/AutoGGUF.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import psutil
import requests
from PyQt6.QtCore import *
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PySide6.QtCore import *
from PySide6.QtGui import *
from PySide6.QtWidgets import *


from DownloadThread import DownloadThread
Expand Down
8 changes: 4 additions & 4 deletions src/DownloadThread.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import zipfile

import requests
from PyQt6.QtCore import *
from PySide6.QtCore import *


class DownloadThread(QThread):
progress_signal = pyqtSignal(int)
finished_signal = pyqtSignal(str)
error_signal = pyqtSignal(str)
progress_signal = Signal(int)
finished_signal = Signal(str)
error_signal = Signal(str)

def __init__(self, url, save_path):
super().__init__()
Expand Down
6 changes: 3 additions & 3 deletions src/GPUMonitor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pynvml
from PyQt6.QtCore import QTimer
from PyQt6.QtGui import QPainter, QPen, QColor
from PyQt6.QtWidgets import (
from PySide6.QtCore import QTimer
from PySide6.QtGui import QPainter, QPen, QColor
from PySide6.QtWidgets import (
QWidget,
QHBoxLayout,
QVBoxLayout,
Expand Down
8 changes: 4 additions & 4 deletions src/KVOverrideEntry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PyQt6.QtWidgets import QWidget, QHBoxLayout, QLineEdit, QComboBox, QPushButton
from PyQt6.QtCore import pyqtSignal, QRegularExpression
from PyQt6.QtGui import QDoubleValidator, QIntValidator, QRegularExpressionValidator
from PySide6.QtWidgets import QWidget, QHBoxLayout, QLineEdit, QComboBox, QPushButton
from PySide6.QtCore import Signal, QRegularExpression
from PySide6.QtGui import QDoubleValidator, QIntValidator, QRegularExpressionValidator
from datetime import datetime
import time
import os
Expand All @@ -9,7 +9,7 @@


class KVOverrideEntry(QWidget):
deleted = pyqtSignal(QWidget)
deleted = Signal(QWidget)

def __init__(self, parent=None):
super().__init__(parent)
Expand Down
1 change: 0 additions & 1 deletion src/Logger.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
from logging.handlers import RotatingFileHandler
import os
import sys
from datetime import datetime


Expand Down
2 changes: 1 addition & 1 deletion src/ModelInfoDialog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PyQt6.QtWidgets import *
from PySide6.QtWidgets import *


class ModelInfoDialog(QDialog):
Expand Down
28 changes: 9 additions & 19 deletions src/QuantizationThread.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
from PyQt6.QtGui import *
import os
import sys
import psutil
import subprocess
import time
import signal
import json
import platform
import requests
import zipfile
import traceback
from datetime import datetime
import subprocess

from PySide6.QtCore import *

from imports_and_globals import open_file_safe
from localizations import *


class QuantizationThread(QThread):
# Define custom signals for communication with the main thread
output_signal = pyqtSignal(str)
status_signal = pyqtSignal(str)
finished_signal = pyqtSignal()
error_signal = pyqtSignal(str)
model_info_signal = pyqtSignal(dict)
output_signal = Signal(str)
status_signal = Signal(str)
finished_signal = Signal()
error_signal = Signal(str)
model_info_signal = Signal(dict)

def __init__(self, command, cwd, log_file):
super().__init__()
Expand Down
16 changes: 2 additions & 14 deletions src/TaskListItem.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
from PyQt6.QtGui import *
import os
import sys
import psutil
import subprocess
import time
import signal
import json
import platform
import requests
import zipfile
from datetime import datetime
from PySide6.QtCore import *
from PySide6.QtWidgets import *


class TaskListItem(QWidget):
Expand Down
2 changes: 1 addition & 1 deletion src/error_handling.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PyQt6.QtWidgets import QMessageBox
from PySide6.QtWidgets import QMessageBox
from localizations import *


Expand Down
6 changes: 3 additions & 3 deletions src/imports_and_globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import requests
import zipfile
from datetime import datetime
from PyQt6.QtWidgets import (
from PySide6.QtWidgets import (
QApplication,
QMainWindow,
QVBoxLayout,
Expand All @@ -35,8 +35,8 @@
QPlainTextEdit,
QMenu,
)
from PyQt6.QtCore import QTimer, QThread, pyqtSignal, Qt, QSize
from PyQt6.QtGui import QCloseEvent, QAction
from PySide6.QtCore import QTimer, Signal, QThread, Qt, QSize
from PySide6.QtGui import QCloseEvent, QAction


def ensure_directory(path):
Expand Down
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from PyQt6.QtWidgets import QApplication
from PySide6.QtWidgets import QApplication
from AutoGGUF import AutoGGUF

if __name__ == "__main__":
Expand Down

0 comments on commit 7e61f6b

Please sign in to comment.