From b37cb1bb9f38f962398021abf1057e4c51573c43 Mon Sep 17 00:00:00 2001 From: Alexander Thiess Date: Mon, 22 Sep 2025 17:37:11 +0200 Subject: [PATCH] fixed update model logic --- src/components/ollama_model_edit.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/ollama_model_edit.py b/src/components/ollama_model_edit.py index 74b1d03..117ccc9 100644 --- a/src/components/ollama_model_edit.py +++ b/src/components/ollama_model_edit.py @@ -74,15 +74,11 @@ class OllamaModelEditComponent(AsyncCard): async def build(self, model_name: str, model_info: dict) -> None: self.classes('w-full') + self.model_name = model_name self.model_name_original = model_name + self.model_info = model_info model_parameters = ollama.model_parameters(model_info) - print(model_parameters) - - # pprint(model_info) - # Always load the existing model data - self.model_name = model_name - # await self.load_existing_model(model_name) with self: with ui.column().classes('w-full gap-2'): @@ -211,12 +207,10 @@ class OllamaModelEditComponent(AsyncCard): ui.switch().bind_value(self, switch_binding).props('dense').set_value(value is not None) ui.label(label).classes('min-w-fit') ui.slider(min=value_min, max=value_max, step=value_step, value=value if value else value_default).classes('flex-1').props('dense').bind_value(self, value_binding).bind_enabled_from(self, switch_binding) - # TODO backward ui.label().bind_text_from(self, value_binding, backward=backward).classes('text-xs text-gray-500 min-w-fit') ui.icon('info', size='sm').classes('text-gray-500 cursor-help').tooltip(info) async def _on_model_name_change(self, value): - print(f'Value({value}) Original({self.model_name_original}) Parent({self.model_info['details']['parent_model']})') if value == self.model_name_original: if len(self.model_info['details']['parent_model']) > 0: self.model_from = self.model_info['details']['parent_model']