Mon, 26 Aug 2024 16:01:11 +0200
Implemented the 'Remove Model' menu action.
# -*- coding: utf-8 -*- # Copyright (c) 2024 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a dialog to show details of the running models. """ from PyQt6.QtWidgets import QDialog, QTreeWidgetItem from eric7 import Globals from .Ui_OllamaRunningModelsDialog import Ui_OllamaRunningModelsDialog class OllamaRunningModelsDialog(QDialog, Ui_OllamaRunningModelsDialog): """ Class implementing a dialog to show details of the running models. """ def __init__(self, models, parent=None): """ Constructor @param models list of available models with details @type list[dict[str: Any]] @param parent reference to the parent widget (defaults to None) @type QWidget (optional) """ super().__init__(parent) self.setupUi(self) for model in models: QTreeWidgetItem( self.modelsList, [ model["name"], model["id"], Globals.dataString(model["size"]), model["processor"], model["expires"].strftime("%Y-%m-%d %H:%M:%S"), ], ) for column in range(self.modelsList.columnCount()): self.modelsList.resizeColumnToContents(column)