mirror of https://github.com/leafspark/AutoGGUF
feat(config): allow setting window size through env
- allow setting window size through env - update version to v1.7.0
This commit is contained in:
parent
432306d2ba
commit
9c2346baec
|
@ -1,6 +1,7 @@
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
|
import os
|
||||||
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from PySide6.QtCore import *
|
from PySide6.QtCore import *
|
||||||
|
@ -89,10 +90,12 @@ def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.logger = Logger("AutoGGUF", "logs")
|
self.logger = Logger("AutoGGUF", "logs")
|
||||||
|
|
||||||
|
width, height = self.parse_resolution()
|
||||||
|
|
||||||
self.logger.info(INITIALIZING_AUTOGGUF)
|
self.logger.info(INITIALIZING_AUTOGGUF)
|
||||||
self.setWindowTitle(WINDOW_TITLE)
|
self.setWindowTitle(WINDOW_TITLE)
|
||||||
self.setWindowIcon(QIcon(resource_path("assets/favicon.ico")))
|
self.setWindowIcon(QIcon(resource_path("assets/favicon.ico")))
|
||||||
self.setGeometry(100, 100, 1700, 1200)
|
self.setGeometry(100, 100, width, height)
|
||||||
self.setWindowFlag(Qt.FramelessWindowHint)
|
self.setWindowFlag(Qt.FramelessWindowHint)
|
||||||
|
|
||||||
ensure_directory(os.path.abspath("quantized_models"))
|
ensure_directory(os.path.abspath("quantized_models"))
|
||||||
|
@ -755,6 +758,16 @@ def __init__(self):
|
||||||
self.load_models()
|
self.load_models()
|
||||||
self.logger.info(AUTOGGUF_INITIALIZATION_COMPLETE)
|
self.logger.info(AUTOGGUF_INITIALIZATION_COMPLETE)
|
||||||
|
|
||||||
|
def parse_resolution(self):
|
||||||
|
res = os.environ.get('AUTOGGUF_RESOLUTION', '1650x1100')
|
||||||
|
try:
|
||||||
|
width, height = map(int, res.split('x'))
|
||||||
|
if width <= 0 or height <= 0:
|
||||||
|
raise ValueError
|
||||||
|
return width, height
|
||||||
|
except (ValueError, AttributeError):
|
||||||
|
return 1650, 1100
|
||||||
|
|
||||||
def resizeEvent(self, event):
|
def resizeEvent(self, event):
|
||||||
super().resizeEvent(event)
|
super().resizeEvent(event)
|
||||||
path = QPainterPath()
|
path = QPainterPath()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
AUTOGGUF_VERSION = "v1.6.2"
|
AUTOGGUF_VERSION = "v1.7.0"
|
||||||
|
|
||||||
|
|
||||||
class _Localization:
|
class _Localization:
|
||||||
|
|
Loading…
Reference in New Issue