adjustments
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -174,4 +174,6 @@ cython_debug/
|
|||||||
# PyPI configuration file
|
# PyPI configuration file
|
||||||
.pypirc
|
.pypirc
|
||||||
|
|
||||||
.nicegui
|
.nicegui
|
||||||
|
|
||||||
|
/config
|
||||||
@@ -91,7 +91,7 @@ class OllamaModelEditComponent(AsyncCard):
|
|||||||
# Basic fields - pre-filled with existing model data
|
# 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.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.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)
|
# 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')
|
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)
|
ui.icon('info', size='sm').classes('text-gray-500 cursor-help').tooltip(info)
|
||||||
|
|
||||||
async def _on_model_name_change(self, value):
|
async def _on_model_name_change(self, value):
|
||||||
return
|
print(f'Value({value}) Original({self.model_name_original}) Parent({self.model_info['details']['parent_model']})')
|
||||||
if self.model_name != self.model_name_original:
|
if value == self.model_name_original:
|
||||||
self.model_from = 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:
|
else:
|
||||||
self.model_from = ''
|
self.model_from = self.model_name_original
|
||||||
if len(self.model_info['details']['parent_model']) > 0:
|
|
||||||
self.model_from = self.model_info['details']['parent_model']
|
|
||||||
|
|
||||||
async def load_existing_model(self, model_name):
|
async def load_existing_model(self, model_name):
|
||||||
"""Load existing model data and populate form fields"""
|
"""Load existing model data and populate form fields"""
|
||||||
|
|||||||
Reference in New Issue
Block a user