Skip to content

Commit ca78bbe

Browse files
authored
v8.0.0
1 parent b0c853c commit ca78bbe

File tree

5 files changed

+60
-24
lines changed

5 files changed

+60
-24
lines changed

src/chart_models_chat.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ def create_chat_models_comparison_plot():
1515
model_categories = {
1616
"coding": {
1717
"models": [
18-
# "Qwen Coder - 1.5b",
19-
# "Qwen Coder - 3b",
2018
"Seed Coder - 8b"
2119
],
2220
"color": "#DAA520",
@@ -40,8 +38,6 @@ def create_chat_models_comparison_plot():
4038
},
4139
"coding_and_thinking": {
4240
"models": [
43-
# "Olympic Coder - 7b",
44-
# "Olympic Coder - 32b"
4541
],
4642
"color": "#8B0000",
4743

src/check_packages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def get_latest_version(self, package_name):
3838
if response.status != 200:
3939
raise Exception(f"PyPI returned status code {response.status}")
4040
return json.load(response)['info']['version']
41-
except urllib.error.URLError as e:
41+
except urllib.error.URLError as e:
4242
raise Exception(f"Network error: {str(e)}")
4343
except TimeoutError:
4444
raise Exception("Connection timed out")
@@ -523,7 +523,7 @@ def open_context_menu(self, position: QPoint):
523523

524524
def show_reverse_dependencies(self, package_name):
525525
try:
526-
command = ["pipdeptree", "--reverse", "--packages", package_name]
526+
command = ["pipdeptree", "--reverse", "--packages", package_name, "--depth", "1"]
527527
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
528528
stdout, stderr = process.communicate()
529529

src/initialize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def get_supported_quantizations(device_type):
4545

4646
def update_config_file(**system_info):
4747
full_config_path = Path('config.yaml').resolve()
48-
48+
4949
with open(full_config_path, 'r', encoding='utf-8') as stream:
5050
config_data = yaml.safe_load(stream)
5151

src/module_ask_jeeves.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from PySide6.QtWidgets import (
2323
QMainWindow, QWidget, QVBoxLayout, QTextEdit,
2424
QLineEdit, QMessageBox, QPushButton, QLabel,
25-
QHBoxLayout, QSizePolicy, QComboBox, QApplication
25+
QHBoxLayout, QSizePolicy, QComboBox, QApplication, QSpinBox
2626
)
2727
from PySide6.QtCore import QThread, Signal, Qt, QTimer, QObject
2828
from PySide6.QtGui import QTextCursor, QPixmap
@@ -38,6 +38,7 @@
3838
from module_kokoro import KokoroTTS
3939
from utilities import normalize_chat_text
4040

41+
4142
class GenerationWorker(QThread):
4243
token_signal = Signal(str)
4344
finished_signal = Signal()
@@ -130,6 +131,17 @@ def __init__(self, parent=None):
130131
self.eject_button.setEnabled(False)
131132
model_layout.addWidget(self.eject_button)
132133

134+
self.context_label = QLabel("Contexts:")
135+
self.context_label.setFixedHeight(30)
136+
137+
self.context_spin = QSpinBox()
138+
self.context_spin.setRange(1, 10) # allow 1-20
139+
self.context_spin.setValue(5) # default 5
140+
self.context_spin.setFixedHeight(30)
141+
142+
model_layout.addWidget(self.context_label)
143+
model_layout.addWidget(self.context_spin)
144+
133145
self.layout.addLayout(model_layout)
134146

135147
self.chat_display = QTextEdit()
@@ -226,6 +238,16 @@ def __init__(self, parent=None):
226238
self.tts_worker = None
227239
self.is_speaking = False
228240

241+
def _ensure_model(self) -> None:
242+
"""
243+
Download or resume-download the model if *model.bin* is missing.
244+
(Keeps everything else that is already in the cache.)
245+
"""
246+
model_dir = Path(self.model_dir)
247+
if not (model_dir / "model.bin").exists():
248+
print("model.bin missing – redownloading just that file …")
249+
self._download_model()
250+
229251
def eject_model(self):
230252
if self.generator:
231253
del self.generator
@@ -294,6 +316,7 @@ def on_model_downloaded(self, model_name, model_type):
294316
self._load_model()
295317

296318
def _load_model(self):
319+
self._ensure_model()
297320
physical_cores = max(1, psutil.cpu_count(logical=False) - 1)
298321
device = "cuda" if torch.cuda.is_available() else "cpu"
299322

@@ -361,6 +384,7 @@ def send_message(self):
361384
self.chat_display.clear()
362385

363386
try:
387+
k_value = self.context_spin.value()
364388
contexts, metadata = self.vector_db.search(user_message, k=5, score_threshold=0.9)
365389
if not contexts:
366390
QMessageBox.warning(self, "No Contexts Found", "No relevant contexts were found for your query.")

src/utilities.py

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,45 @@ def set_cuda_paths():
2424
import sys
2525
import os
2626
from pathlib import Path
27+
# virtual environment path
2728
venv_base = Path(sys.executable).parent.parent
28-
nvidia_base_path = venv_base / 'Lib' / 'site-packages' / 'nvidia'
29-
cuda_path_runtime = nvidia_base_path / 'cuda_runtime' / 'bin'
30-
cuda_path_runtime_lib = nvidia_base_path / 'cuda_runtime' / 'lib' / 'x64'
31-
cuda_path_runtime_include = nvidia_base_path / 'cuda_runtime' / 'include'
32-
cublas_path = nvidia_base_path / 'cublas' / 'bin'
33-
cudnn_path = nvidia_base_path / 'cudnn' / 'bin'
34-
nvrtc_path = nvidia_base_path / 'cuda_nvrtc' / 'bin'
35-
nvcc_path = nvidia_base_path / 'cuda_nvcc' / 'bin'
29+
30+
# dependencies path
31+
dependency_base = venv_base / 'Lib' / 'site-packages'
32+
33+
# nvidia base path
34+
nvidia_base = dependency_base / 'nvidia'
35+
36+
# nvidia specific component paths
37+
cuda_runtime = nvidia_base / 'cuda_runtime' / 'bin'
38+
cuda_runtime_lib = nvidia_base / 'cuda_runtime' / 'lib' / 'x64'
39+
cuda_runtime_include = nvidia_base / 'cuda_runtime' / 'include'
40+
cublas = nvidia_base / 'cublas' / 'bin'
41+
cudnn = nvidia_base / 'cudnn' / 'bin'
42+
nvrtc = nvidia_base / 'cuda_nvrtc' / 'bin'
43+
nvcc = nvidia_base / 'cuda_nvcc' / 'bin'
44+
cusparse = nvidia_base / 'cusparse' / 'bin'
45+
46+
# unique cusparselt path
47+
# cusparselt = dependency_base / 'cusparselt' / 'bin'
48+
3649
paths_to_add = [
37-
str(cuda_path_runtime),
38-
str(cuda_path_runtime_lib),
39-
str(cuda_path_runtime_include),
40-
str(cublas_path),
41-
str(cudnn_path),
42-
str(nvrtc_path),
43-
str(nvcc_path),
50+
str(cuda_runtime),
51+
str(cuda_runtime_lib),
52+
str(cuda_runtime_include),
53+
str(cublas),
54+
str(cudnn),
55+
str(nvrtc),
56+
str(nvcc),
57+
str(cusparse),
58+
# str(cusparselt),
4459
]
60+
4561
current_value = os.environ.get('PATH', '')
4662
new_value = os.pathsep.join(paths_to_add + ([current_value] if current_value else []))
4763
os.environ['PATH'] = new_value
4864

49-
triton_cuda_path = nvidia_base_path / 'cuda_runtime'
65+
triton_cuda_path = nvidia_base / 'cuda_runtime'
5066
current_cuda_path = os.environ.get('CUDA_PATH', '')
5167
new_cuda_path = os.pathsep.join([str(triton_cuda_path)] + ([current_cuda_path] if current_cuda_path else []))
5268
os.environ['CUDA_PATH'] = new_cuda_path

0 commit comments

Comments
 (0)