Added support for multiple tags on a single model
This commit is contained in:
1 parent
8ddce304b2
commit
02acbb2d70
571 files changed
+76910
-127
No files matched your search
+2
-91
@@ -1,92 +1,3 @@
|
||||
# available_models.py
|
||||
# There isn't an API to do this, sorry
|
||||
available_models = {
|
||||
"llama3":"Meta Llama 3: The most capable openly available LLM to date",
|
||||
"phi3":"Phi-3 Mini is a 3.8B parameters, lightweight, state-of-the-art open model by Microsoft.",
|
||||
"wizardlm2":"State of the art large language model from Microsoft AI with improved performance on complex chat, multilingual, reasoning and agent use cases.",
|
||||
"mistral":"The 7B model released by Mistral AI, updated to version 0.2.",
|
||||
"gemma":"Gemma is a family of lightweight, state-of-the-art open models built by Google DeepMind. Updated to version 1.1",
|
||||
"mixtral":"A set of Mixture of Experts (MoE) model with open weights by Mistral AI in 8x7b and 8x22b parameter sizes.",
|
||||
"llama2":"Llama 2 is a collection of foundation language models ranging from 7B to 70B parameters.",
|
||||
"codegemma":"CodeGemma is a collection of powerful, lightweight models that can perform a variety of coding tasks like fill-in-the-middle code completion, code generation, natural language understanding, mathematical reasoning, and instruction following.",
|
||||
"command-r":"Command R is a Large Language Model optimized for conversational interaction and long context tasks.",
|
||||
"command-r-plus":"Command R+ is a powerful, scalable large language model purpose-built to excel at real-world enterprise use cases.",
|
||||
"llava":"🌋 LLaVA is a novel end-to-end trained large multimodal model that combines a vision encoder and Vicuna for general-purpose visual and language understanding. Updated to version 1.6.",
|
||||
"dbrx":"DBRX is an open, general-purpose LLM created by Databricks.",
|
||||
"codellama":"A large language model that can use text prompts to generate and discuss code.",
|
||||
"qwen":"Qwen 1.5 is a series of large language models by Alibaba Cloud spanning from 0.5B to 110B parameters",
|
||||
"dolphin-mixtral":"Uncensored, 8x7b and 8x22b fine-tuned models based on the Mixtral mixture of experts models that excels at coding tasks. Created by Eric Hartford.",
|
||||
"llama2-uncensored":"Uncensored Llama 2 model by George Sung and Jarrad Hope.",
|
||||
"deepseek-coder":"DeepSeek Coder is a capable coding model trained on two trillion code and natural language tokens.",
|
||||
"mistral-openorca":"Mistral OpenOrca is a 7 billion parameter model, fine-tuned on top of the Mistral 7B model using the OpenOrca dataset.",
|
||||
"nomic-embed-text":"A high-performing open embedding model with a large token context window.",
|
||||
"phi":"Phi-2: a 2.7B language model by Microsoft Research that demonstrates outstanding reasoning and language understanding capabilities.",
|
||||
"dolphin-mistral":"The uncensored Dolphin model based on Mistral that excels at coding tasks. Updated to version 2.8.",
|
||||
"orca-mini":"A general-purpose model ranging from 3 billion parameters to 70 billion, suitable for entry-level hardware.",
|
||||
"nous-hermes2":"The powerful family of models by Nous Research that excels at scientific discussion and coding tasks.",
|
||||
"zephyr":"Zephyr is a series of fine-tuned versions of the Mistral and Mixtral models that are trained to act as helpful assistants.",
|
||||
"llama2-chinese":"Llama 2 based model fine tuned to improve Chinese dialogue ability.",
|
||||
"wizard-vicuna-uncensored":"Wizard Vicuna Uncensored is a 7B, 13B, and 30B parameter model based on Llama 2 uncensored by Eric Hartford.",
|
||||
"vicuna":"General use chat model based on Llama and Llama 2 with 2K to 16K context sizes.",
|
||||
"starcoder2":"StarCoder2 is the next generation of transparently trained open code LLMs that comes in three sizes: 3B, 7B and 15B parameters.",
|
||||
"openhermes":"OpenHermes 2.5 is a 7B model fine-tuned by Teknium on Mistral with fully open datasets.",
|
||||
"tinyllama":"The TinyLlama project is an open endeavor to train a compact 1.1B Llama model on 3 trillion tokens.",
|
||||
"openchat":"A family of open-source models trained on a wide variety of data, surpassing ChatGPT on various benchmarks. Updated to version 3.5-0106.",
|
||||
"tinydolphin":"An experimental 1.1B parameter model trained on the new Dolphin 2.8 dataset by Eric Hartford and based on TinyLlama.",
|
||||
"starcoder":"StarCoder is a code generation model trained on 80+ programming languages.",
|
||||
"wizardcoder":"State-of-the-art code generation model",
|
||||
"stable-code":"Stable Code 3B is a coding model with instruct and code completion variants on par with models such as Code Llama 7B that are 2.5x larger.",
|
||||
"dolphin-llama3":"Dolphin 2.9 is a new model with 8B and 70B sizes by Eric Hartford based on Llama 3 that has a variety of instruction, conversational, and coding skills.",
|
||||
"yi":"A high-performing, bilingual language model.",
|
||||
"mxbai-embed-large":"State-of-the-art large embedding model from mixedbread.ai",
|
||||
"neural-chat":"A fine-tuned model based on Mistral with good coverage of domain and language.",
|
||||
"phind-codellama":"Code generation model based on Code Llama.",
|
||||
"wizard-math":"Model focused on math and logic problems",
|
||||
"starling-lm":"Starling is a large language model trained by reinforcement learning from AI feedback focused on improving chatbot helpfulness.",
|
||||
"falcon":"A large language model built by the Technology Innovation Institute (TII) for use in summarization, text generation, and chat bots.",
|
||||
"orca2":"Orca 2 is built by Microsoft research, and are a fine-tuned version of Meta's Llama 2 models. The model is designed to excel particularly in reasoning.",
|
||||
"dolphincoder":"A 7B and 15B uncensored variant of the Dolphin model family that excels at coding, based on StarCoder2.",
|
||||
"dolphin-phi":"2.7B uncensored Dolphin model by Eric Hartford, based on the Phi language model by Microsoft Research.",
|
||||
"nous-hermes":"General use models based on Llama and Llama 2 from Nous Research.",
|
||||
"sqlcoder":"SQLCoder is a code completion model fined-tuned on StarCoder for SQL generation tasks",
|
||||
"solar":"A compact, yet powerful 10.7B large language model designed for single-turn conversation.",
|
||||
"stablelm2":"Stable LM 2 is a state-of-the-art 1.6B and 12B parameter language model trained on multilingual data in English, Spanish, German, Italian, French, Portuguese, and Dutch.",
|
||||
"bakllava":"BakLLaVA is a multimodal model consisting of the Mistral 7B base model augmented with the LLaVA architecture.",
|
||||
"medllama2":"Fine-tuned Llama 2 model to answer medical questions based on an open source medical dataset.",
|
||||
"yarn-llama2":"An extension of Llama 2 that supports a context of up to 128k tokens.",
|
||||
"deepseek-llm":"An advanced language model crafted with 2 trillion bilingual tokens.",
|
||||
"nous-hermes2-mixtral":"The Nous Hermes 2 model from Nous Research, now trained over Mixtral.",
|
||||
"wizardlm-uncensored":"Uncensored version of Wizard LM model",
|
||||
"codeqwen":"CodeQwen1.5 is a large language model pretrained on a large amount of code data.",
|
||||
"all-minilm":"Embedding models on very large sentence level datasets.",
|
||||
"samantha-mistral":"A companion assistant trained in philosophy, psychology, and personal relationships. Based on Mistral.",
|
||||
"codeup":"Great code generation model based on Llama2.",
|
||||
"stable-beluga":"Llama 2 based model fine tuned on an Orca-style dataset. Originally called Free Willy.",
|
||||
"llama3-gradient":"This model extends LLama-3 8B's context length from 8k to over 1m tokens.",
|
||||
"everythinglm":"Uncensored Llama2 based model with support for a 16K context window.",
|
||||
"xwinlm":"Conversational model based on Llama 2 that performs competitively on various benchmarks.",
|
||||
"yarn-mistral":"An extension of Mistral to support context windows of 64K or 128K.",
|
||||
"meditron":"Open-source medical large language model adapted from Llama 2 to the medical domain.",
|
||||
"wizardlm":"General use model based on Llama 2.",
|
||||
"llama-pro":"An expansion of Llama 2 that specializes in integrating both general language understanding and domain-specific knowledge, particularly in programming and mathematics.",
|
||||
"magicoder":"🎩 Magicoder is a family of 7B parameter models trained on 75K synthetic instruction data using OSS-Instruct, a novel approach to enlightening LLMs with open-source code snippets.",
|
||||
"stablelm-zephyr":"A lightweight chat model allowing accurate, and responsive output without requiring high-end hardware.",
|
||||
"codebooga":"A high-performing code instruct model created by merging two existing code models.",
|
||||
"nexusraven":"Nexus Raven is a 13B instruction tuned model for function calling tasks.",
|
||||
"mistrallite":"MistralLite is a fine-tuned model based on Mistral with enhanced capabilities of processing long contexts.",
|
||||
"wizard-vicuna":"Wizard Vicuna is a 13B parameter model based on Llama 2 trained by MelodysDreamj.",
|
||||
"goliath":"A language model created by combining two fine-tuned Llama 2 70B models into one.",
|
||||
"open-orca-platypus2":"Merge of the Open Orca OpenChat model and the Garage-bAInd Platypus 2 model. Designed for chat and code generation.",
|
||||
"notux":"A top-performing mixture of experts model, fine-tuned with high-quality data.",
|
||||
"megadolphin":"MegaDolphin-2.2-120b is a transformation of Dolphin-2.2-70b created by interleaving the model with itself.",
|
||||
"snowflake-arctic-embed":"A suite of text embedding models by Snowflake, optimized for performance.",
|
||||
"duckdb-nsql":"7B parameter text-to-SQL model made by MotherDuck and Numbers Station.",
|
||||
"moondream":"moondream is a small vision language model designed to run efficiently on edge devices.",
|
||||
"notus":"A 7B chat model fine-tuned with high-quality data and based on Zephyr.",
|
||||
"alfred":"A robust conversational model designed to be used for both chat and instruct use cases.",
|
||||
"llava-llama3":"A LLaVA model fine-tuned from Llama 3 Instruct with better scores in several benchmarks.",
|
||||
"llama3-chatqa":"A model from NVIDIA based on Llama 3 that excels at conversational question answering (QA) and retrieval-augmented generation (RAG).",
|
||||
"llava-phi3":"A new small LLaVA model fine-tuned from Phi 3 Mini."
|
||||
}
|
||||
|
||||
|
||||
# There's no API for this, sorry
|
||||
available_models = {"llama3": {"description": "Meta Llama 3: The most capable openly available LLM to date", "tags": ["latest", "70b", "8b", "instruct", "text", "70b-instruct", "70b-text", "70b-instruct-q4_0", "70b-instruct-q4_1", "70b-instruct-q5_0", "70b-instruct-q5_1", "70b-instruct-q8_0", "70b-instruct-q2_K", "70b-instruct-q3_K_S", "70b-instruct-q3_K_M", "70b-instruct-q3_K_L", "70b-instruct-q4_K_S", "70b-instruct-q4_K_M", "70b-instruct-q5_K_S", "70b-instruct-q5_K_M", "70b-instruct-q6_K", "70b-instruct-fp16", "70b-text-q4_0", "70b-text-q4_1", "70b-text-q5_0", "70b-text-q5_1", "70b-text-q8_0", "70b-text-q2_K", "70b-text-q3_K_S", "70b-text-q3_K_M", "70b-text-q3_K_L", "70b-text-q4_K_S", "70b-text-q4_K_M", "70b-text-q5_K_S", "70b-text-q5_K_M", "70b-text-q6_K", "70b-text-fp16", "8b-text", "8b-instruct-q4_0", "8b-instruct-q4_1", "8b-instruct-q5_0", "8b-instruct-q5_1", "8b-instruct-q8_0", "8b-instruct-q2_K", "8b-instruct-q3_K_S", "8b-instruct-q3_K_M", "8b-instruct-q3_K_L", "8b-instruct-q4_K_S", "8b-instruct-q4_K_M", "8b-instruct-q5_K_S", "8b-instruct-q5_K_M", "8b-instruct-q6_K", "8b-instruct-fp16", "8b-text-q4_0", "8b-text-q4_1", "8b-text-q5_0", "8b-text-q5_1", "8b-text-q8_0", "8b-text-q2_K", "8b-text-q3_K_S", "8b-text-q3_K_M", "8b-text-q3_K_L", "8b-text-q4_K_S", "8b-text-q4_K_M", "8b-text-q5_K_S", "8b-text-q6_K", "8b-text-fp16"]}, "phi3": {"description": "Phi-3 Mini is a 3.8B parameters, lightweight, state-of-the-art open model by Microsoft.", "tags": ["latest", "3.8b", "instruct", "mini", "3.8b-mini-instruct-4k-q4_K_M", "3.8b-mini-instruct-4k-fp16"]}, "wizardlm2": {"description": "State of the art large language model from Microsoft AI with improved performance on complex chat, multilingual, reasoning and agent use cases.", "tags": ["latest", "8x22b", "7b", "8x22b-q4_0", "8x22b-q8_0", "8x22b-q2_K", "8x22b-fp16", "7b-q4_0", "7b-q4_1", "7b-q5_0", "7b-q5_1", "7b-q8_0", "7b-q2_K", "7b-q3_K_S", "7b-q3_K_M", "7b-q3_K_L", "7b-q4_K_S", "7b-q4_K_M", "7b-q5_K_S", "7b-q5_K_M", "7b-q6_K", "7b-fp16"]}, "mistral": {"description": "The 7B model released by Mistral AI, updated to version 0.2.", "tags": ["latest", "7b", "instruct", "text", "v0.1", "v0.2", "7b-instruct", "7b-text", "7b-instruct-q4_0", "7b-instruct-q4_1", "7b-instruct-q5_0", "7b-instruct-q5_1", "7b-instruct-q8_0", "7b-instruct-q2_K", "7b-instruct-q3_K_S", "7b-instruct-q3_K_M", "7b-instruct-q3_K_L", "7b-instruct-q4_K_S", "7b-instruct-q4_K_M", "7b-instruct-q5_K_S", "7b-instruct-q5_K_M", "7b-instruct-q6_K", "7b-instruct-fp16", "7b-text-q4_0", "7b-text-q4_1", "7b-text-q5_0", "7b-text-q5_1", "7b-text-q8_0", "7b-text-q2_K", "7b-text-q3_K_S", "7b-text-q3_K_M", "7b-text-q3_K_L", "7b-text-q4_K_S", "7b-text-q4_K_M", "7b-text-q5_K_S", "7b-text-q5_K_M", "7b-text-q6_K", "7b-text-fp16", "7b-instruct-v0.2-q4_0", "7b-instruct-v0.2-q4_1", "7b-instruct-v0.2-q5_0", "7b-instruct-v0.2-q5_1", "7b-instruct-v0.2-q8_0", "7b-instruct-v0.2-q2_K", "7b-instruct-v0.2-q3_K_S", "7b-instruct-v0.2-q3_K_M", "7b-instruct-v0.2-q3_K_L", "7b-instruct-v0.2-q4_K_S", "7b-instruct-v0.2-q4_K_M", "7b-instruct-v0.2-q5_K_S", "7b-instruct-v0.2-q5_K_M", "7b-instruct-v0.2-q6_K", "7b-instruct-v0.2-fp16", "7b-text-v0.2-q4_0", "7b-text-v0.2-q4_1", "7b-text-v0.2-q5_0", "7b-text-v0.2-q5_1", "7b-text-v0.2-q8_0", "7b-text-v0.2-q2_K", "7b-text-v0.2-q3_K_S", "7b-text-v0.2-q3_K_M", "7b-text-v0.2-q3_K_L", "7b-text-v0.2-q4_K_S", "7b-text-v0.2-q4_K_M", "7b-text-v0.2-q5_K_S", "7b-text-v0.2-q5_K_M", "7b-text-v0.2-q6_K", "7b-text-v0.2-fp16"]}, "gemma": {"description": "Gemma is a family of lightweight, state-of-the-art open models built by Google DeepMind. Updated to version 1.1", "tags": ["latest", "7b", "2b", "instruct", "text", "v1.1", "7b-instruct", "7b-text", "7b-v1.1", "7b-instruct-q4_0", "7b-instruct-q4_1", "7b-instruct-q5_0", "7b-instruct-q5_1", "7b-instruct-q8_0", "7b-instruct-q2_K", "7b-instruct-q3_K_S", "7b-instruct-q3_K_M", "7b-instruct-q3_K_L", "7b-instruct-q4_K_S", "7b-instruct-q4_K_M", "7b-instruct-q5_K_S", "7b-instruct-q5_K_M", "7b-instruct-q6_K", "7b-instruct-fp16", "7b-text-q4_0", "7b-text-q4_1", "7b-text-q5_0", "7b-text-q5_1", "7b-text-q8_0", "7b-text-q2_K", "7b-text-q3_K_S", "7b-text-q3_K_M", "7b-text-q3_K_L", "7b-text-q4_K_S", "7b-text-q4_K_M", "7b-text-q5_K_S", "7b-text-q5_K_M", "7b-text-q6_K", "7b-text-fp16", "7b-instruct-v1.1-q4_0", "7b-instruct-v1.1-q4_1", "7b-instruct-v1.1-q5_0", "7b-instruct-v1.1-q5_1", "7b-instruct-v1.1-q8_0", "7b-instruct-v1.1-q2_K", "7b-instruct-v1.1-q3_K_S", "7b-instruct-v1.1-q3_K_M", "7b-instruct-v1.1-q3_K_L", "7b-instruct-v1.1-q4_K_S", "7b-instruct-v1.1-q4_K_M", "7b-instruct-v1.1-q5_K_S", "7b-instruct-v1.1-q5_K_M", "7b-instruct-v1.1-q6_K", "7b-instruct-v1.1-fp16", "2b-instruct", "2b-text", "2b-v1.1", "2b-instruct-q4_0", "2b-instruct-q4_1", "2b-instruct-q5_0", "2b-instruct-q5_1", "2b-instruct-q8_0", "2b-instruct-q2_K", "2b-instruct-q3_K_S", "2b-instruct-q3_K_M", "2b-instruct-q3_K_L", "2b-instruct-q4_K_S", "2b-instruct-q4_K_M", "2b-instruct-q5_K_S", "2b-instruct-q5_K_M", "2b-inLine truncated
|
||||
+80
-29
@@ -64,7 +64,8 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
||||
|
||||
manage_models_button = Gtk.Template.Child()
|
||||
manage_models_dialog = Gtk.Template.Child()
|
||||
model_list_box = Gtk.Template.Child()
|
||||
available_model_list_box = Gtk.Template.Child()
|
||||
local_model_list_box = Gtk.Template.Child()
|
||||
|
||||
pull_model_dialog = Gtk.Template.Child()
|
||||
pull_model_status_page = Gtk.Template.Child()
|
||||
@@ -303,18 +304,13 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
||||
thread = threading.Thread(target=self.run_message, args=(data['messages'], data['model']))
|
||||
thread.start()
|
||||
|
||||
def delete_model(self, dialog, task, model_name, button):
|
||||
def delete_model(self, dialog, task, model_name):
|
||||
if dialog.choose_finish(task) == "delete":
|
||||
response = simple_delete(self.ollama_url + "/api/delete", data={"name": model_name})
|
||||
self.update_list_local_models()
|
||||
self.update_list_available_models()
|
||||
if response['status'] == 'ok':
|
||||
button.set_icon_name("folder-download-symbolic")
|
||||
button.set_css_classes(["accent", "pull"])
|
||||
self.show_toast("good", 0, self.manage_models_overlay)
|
||||
for i in range(self.model_string_list.get_n_items()):
|
||||
if self.model_string_list.get_string(i) == model_name:
|
||||
self.model_string_list.remove(i)
|
||||
self.model_drop_down.set_selected(0)
|
||||
break
|
||||
else:
|
||||
self.show_toast("error", 3, self.connection_overlay)
|
||||
self.manage_models_dialog.close()
|
||||
@@ -330,17 +326,17 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
||||
GLib.idle_add(self.pull_model_progress_bar.set_fraction, 0.0)
|
||||
except Exception as e: print(e)
|
||||
|
||||
def pull_model(self, dialog, task, model_name, button):
|
||||
def pull_model(self, dialog, task, model_name, tag):
|
||||
if dialog.choose_finish(task) == "pull":
|
||||
data = {"name":model_name}
|
||||
data = {"name":f"{model_name}:{tag}"}
|
||||
|
||||
GLib.idle_add(self.pull_model_dialog.present, self.manage_models_dialog)
|
||||
response = stream_post(f"{self.ollama_url}/api/pull", data=json.dumps(data), callback=self.pull_model_update)
|
||||
|
||||
GLib.idle_add(self.update_list_local_models)
|
||||
GLib.idle_add(self.update_list_available_models)
|
||||
GLib.idle_add(self.pull_model_dialog.force_close)
|
||||
if response['status'] == 'ok':
|
||||
GLib.idle_add(button.set_icon_name, "user-trash-symbolic")
|
||||
GLib.idle_add(button.set_css_classes, ["error", "delete"])
|
||||
GLib.idle_add(self.model_string_list.append, model_name)
|
||||
GLib.idle_add(self.show_toast, "good", 1, self.manage_models_overlay)
|
||||
else:
|
||||
GLib.idle_add(self.show_toast, "error", 4, self.connection_overlay)
|
||||
@@ -348,9 +344,10 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
||||
GLib.idle_add(self.show_connection_dialog, True)
|
||||
|
||||
|
||||
def pull_model_start(self, dialog, task, model_name, button):
|
||||
self.pull_model_status_page.set_description(model_name)
|
||||
thread = threading.Thread(target=self.pull_model, args=(dialog, task, model_name, button))
|
||||
def pull_model_start(self, dialog, task, model_name, tag_drop_down):
|
||||
tag = tag_drop_down.get_selected_item().get_string()
|
||||
self.pull_model_status_page.set_description(f"{model_name}:{tag}")
|
||||
thread = threading.Thread(target=self.pull_model, args=(dialog, task, model_name, tag))
|
||||
thread.start()
|
||||
|
||||
def model_action_button_activate(self, button, model_name):
|
||||
@@ -370,27 +367,81 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
||||
self.delete_model(dialog, task, model_name, button) if action == "delete" else self.pull_model_start(dialog, task, model_name,button)
|
||||
)
|
||||
|
||||
def model_delete_button_activate(self, model_name):
|
||||
dialog = Adw.AlertDialog(
|
||||
heading="Delete Model",
|
||||
body=f"Are you sure you want to delete '{model_name}'?",
|
||||
close_response="cancel"
|
||||
)
|
||||
dialog.add_response("cancel", "Cancel")
|
||||
dialog.add_response("delete", "Delete")
|
||||
dialog.set_response_appearance("delete", Adw.ResponseAppearance.DESTRUCTIVE)
|
||||
dialog.choose(
|
||||
parent = self.manage_models_dialog,
|
||||
cancellable = None,
|
||||
callback = lambda dialog, task, model_name = model_name: self.delete_model(dialog, task, model_name)
|
||||
)
|
||||
|
||||
def model_pull_button_activate(self, model_name):
|
||||
tag_list = Gtk.StringList()
|
||||
for tag in available_models[model_name]['tags']:
|
||||
tag_list.append(tag)
|
||||
tag_drop_down = Gtk.DropDown(
|
||||
enable_search=True,
|
||||
model=tag_list
|
||||
)
|
||||
dialog = Adw.AlertDialog(
|
||||
heading="Pull Model",
|
||||
body=f"Please select a tag to pull '{model_name}'",
|
||||
extra_child=tag_drop_down,
|
||||
close_response="cancel"
|
||||
)
|
||||
dialog.add_response("cancel", "Cancel")
|
||||
dialog.add_response("pull", "Pull")
|
||||
dialog.set_response_appearance("pull", Adw.ResponseAppearance.SUGGESTED)
|
||||
dialog.choose(
|
||||
parent = self.manage_models_dialog,
|
||||
cancellable = None,
|
||||
callback = lambda dialog, task, model_name = model_name, tag_drop_down = tag_drop_down: self.pull_model_start(dialog, task, model_name, tag_drop_down)
|
||||
)
|
||||
|
||||
def update_list_available_models(self):
|
||||
self.model_list_box.remove_all()
|
||||
for model_name, model_description in available_models.items():
|
||||
self.local_model_list_box.remove_all()
|
||||
self.available_model_list_box.remove_all()
|
||||
for model_name in self.local_models:
|
||||
model = Adw.ActionRow(
|
||||
title = model_name,
|
||||
subtitle = model_description,
|
||||
title = model_name.split(":")[0],
|
||||
subtitle = model_name.split(":")[1]
|
||||
)
|
||||
if ":" not in model_name: model_name += ":latest"
|
||||
button = Gtk.Button(
|
||||
icon_name = "folder-download-symbolic" if model_name not in self.local_models else "user-trash-symbolic",
|
||||
icon_name = "user-trash-symbolic",
|
||||
vexpand = False,
|
||||
valign = 3,
|
||||
css_classes = ["accent", "pull"] if model_name not in self.local_models else ["error", "delete"])
|
||||
button.connect("clicked", lambda button=button, model_name=model_name: self.model_action_button_activate(button, model_name))
|
||||
css_classes = ["error", "delete"]
|
||||
)
|
||||
button.connect("clicked", lambda button=button, model_name=model_name: self.model_delete_button_activate(model_name))
|
||||
model.add_suffix(button)
|
||||
self.model_list_box.append(model)
|
||||
self.local_model_list_box.append(model)
|
||||
|
||||
def manage_models_button_activate(self, button):
|
||||
self.manage_models_dialog.present(self)
|
||||
for name, model_info in available_models.items():
|
||||
model = Adw.ActionRow(
|
||||
title = name,
|
||||
subtitle = model_info['description'],
|
||||
)
|
||||
button = Gtk.Button(
|
||||
icon_name = "folder-download-symbolic",
|
||||
vexpand = False,
|
||||
valign = 3,
|
||||
css_classes = ["accent", "pull"]
|
||||
)
|
||||
button.connect("clicked", lambda button=button, model_name=name: self.model_pull_button_activate(model_name))
|
||||
model.add_suffix(button)
|
||||
self.available_model_list_box.append(model)
|
||||
|
||||
def manage_models_button_activate(self, button=None):
|
||||
self.update_list_local_models()
|
||||
self.update_list_available_models()
|
||||
|
||||
self.manage_models_dialog.present(self)
|
||||
|
||||
def connection_carousel_page_changed(self, carousel, index):
|
||||
if index == 0: self.connection_previous_button.set_sensitive(False)
|
||||
|
||||
+16
-5
@@ -199,7 +199,7 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="margin-top">0</property>
|
||||
@@ -207,11 +207,22 @@
|
||||
<property name="margin-start">24</property>
|
||||
<property name="margin-end">24</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="vexpand">true</property>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">1</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="model_list_box">
|
||||
<object class="GtkListBox" id="local_model_list_box">
|
||||
<property name="selection-mode">none</property>
|
||||
<style>
|
||||
<class name="boxed-list"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"></object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBox" id="available_model_list_box">
|
||||
<property name="selection-mode">none</property>
|
||||
<style>
|
||||
<class name="boxed-list"/>
|
||||
|
||||
Reference in new issue
Block a user