Fixed error on config save
This commit is contained in:
parent
c283f3f1d2
commit
80aabcb805
@ -496,20 +496,21 @@ Generate a title following these rules:
|
|||||||
self.chat_list_box.rename_chat(old_chat_name, new_chat_name)
|
self.chat_list_box.rename_chat(old_chat_name, new_chat_name)
|
||||||
|
|
||||||
def save_server_config(self):
|
def save_server_config(self):
|
||||||
with open(os.path.join(config_dir, "server.json"), "w+", encoding="utf-8") as f:
|
if self.ollama_instance:
|
||||||
data = {
|
with open(os.path.join(config_dir, "server.json"), "w+", encoding="utf-8") as f:
|
||||||
'remote_url': self.ollama_instance.remote_url,
|
data = {
|
||||||
'remote_bearer_token': self.ollama_instance.bearer_token,
|
'remote_url': self.ollama_instance.remote_url,
|
||||||
'run_remote': self.ollama_instance.remote,
|
'remote_bearer_token': self.ollama_instance.bearer_token,
|
||||||
'local_port': self.ollama_instance.local_port,
|
'run_remote': self.ollama_instance.remote,
|
||||||
'run_on_background': self.background_switch.get_active(),
|
'local_port': self.ollama_instance.local_port,
|
||||||
'powersaver_warning': self.powersaver_warning_switch.get_active(),
|
'run_on_background': self.background_switch.get_active(),
|
||||||
'model_tweaks': self.ollama_instance.tweaks,
|
'powersaver_warning': self.powersaver_warning_switch.get_active(),
|
||||||
'ollama_overrides': self.ollama_instance.overrides,
|
'model_tweaks': self.ollama_instance.tweaks,
|
||||||
'idle_timer': self.ollama_instance.idle_timer_delay
|
'ollama_overrides': self.ollama_instance.overrides,
|
||||||
}
|
'idle_timer': self.ollama_instance.idle_timer_delay
|
||||||
|
}
|
||||||
|
|
||||||
json.dump(data, f, indent=6)
|
json.dump(data, f, indent=6)
|
||||||
|
|
||||||
def verify_connection(self):
|
def verify_connection(self):
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user