adjustments

This commit is contained in:
2025-09-22 15:13:09 +02:00
parent 6b060f9865
commit 5b745c045f
2 changed files with 11 additions and 8 deletions

2
.gitignore vendored
View File

@@ -175,3 +175,5 @@ cython_debug/
.pypirc
.nicegui
/config

View File

@@ -91,7 +91,7 @@ class OllamaModelEditComponent(AsyncCard):
# Basic fields - pre-filled with existing model data
ui.input('Model Name', value=model_name, on_change=lambda e: self._on_model_name_change(e.value)).props('outlined dense').classes('w-full').bind_value(self, 'model_name').tooltip('Keep the same name to update the existing model, or change it to create a new model')
# ui.label().props('outlined dense').classes('w-full').bind_text_from(self, 'model_from')
ui.input('From', value=model_info['details']['parent_model']).props('outlined dense').classes('w-full').bind_value(self, 'model_from').set_enabled(False)
ui.input('From', value=model_info['details']['parent_model']).props('outlined dense').classes('w-full').bind_value_from(self, 'model_from').set_enabled(False)
# System message field (commonly used)
ui.textarea('System Message', placeholder='You are a helpful assistant...', value=model_info['system'] if 'system' in model_info else '').classes('w-full').props('autogrow outlined').bind_value(self, 'system_message')
@@ -216,13 +216,14 @@ class OllamaModelEditComponent(AsyncCard):
ui.icon('info', size='sm').classes('text-gray-500 cursor-help').tooltip(info)
async def _on_model_name_change(self, value):
return
if self.model_name != self.model_name_original:
self.model_from = self.model_name_original
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']
else:
self.model_from = ''
else:
self.model_from = ''
if len(self.model_info['details']['parent_model']) > 0:
self.model_from = self.model_info['details']['parent_model']
self.model_from = self.model_name_original
async def load_existing_model(self, model_name):
"""Load existing model data and populate form fields"""