Adding size to tags and adding progress bar to models that are being pulled

This commit is contained in:
jeffser committed 2024-05-27 17:27:05 -06:00
1 parent aa79368b54
commit 05461fb03a
3 files changed
+13 -7

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
# available_models.py
# There's no API for this, sorry
available_models = {"llama3": {"url": "https://ollama.com/library/llama3", "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-q5_K_M", "8b-text-q6_K", "8b-text-fp16"], "image": False}, "phi3": {"url": "https://ollama.com/library/phi3", "tags": ["latest", "14b", "3.8b", "instruct", "medium", "mini", "14b-instruct", "14b-medium-4k-instruct-f16", "14b-medium-4k-instruct-q4_0", "14b-medium-128k-instruct-q4_0", "14b-medium-4k-instruct-q4_1", "14b-medium-128k-instruct-q4_1", "14b-medium-4k-instruct-q5_0", "14b-medium-4k-instruct-q5_1", "14b-medium-4k-instruct-q8_0", "14b-medium-4k-instruct-q2_K", "14b-medium-4k-instruct-q3_K_S", "14b-medium-4k-instruct-q3_K_M", "14b-medium-4k-instruct-q3_K_L", "14b-medium-4k-instruct-q4_K_S", "14b-medium-4k-instruct-q4_K_M", "14b-medium-4k-instruct-q5_K_S", "14b-medium-4k-instruct-q5_K_M", "14b-medium-4k-instruct-q6_K", "3.8b-mini-instruct-4k-q4_K_M", "3.8b-mini-instruct-4k-fp16", "medium-128k"], "image": False}, "aya": {"url": "https://ollama.com/library/aya", "tags": ["latest", "35b", "8b", "35b-23", "35b-23-f16", "35b-23-q4_0", "35b-23-q4_1", "35b-23-q5_0", "35b-23-q5_1", "35b-23-q8_0", "35b-23-q2_K", "35b-23-q3_K_S", "35b-23-q3_K_M", "35b-23-q3_K_L", "35b-23-q4_K_S", "35b-23-q4_K_M", "35b-23-q5_K_S", "35b-23-q5_K_M", "35b-23-q6_K", "8b-23", "8b-23-f16", "8b-23-q4_0", "8b-23-q4_1", "8b-23-q5_0", "8b-23-q5_1", "8b-23-q8_0", "8b-23-q2_K", "8b-23-q3_K_S", "8b-23-q3_K_M", "8b-23-q3_K_L", "8b-23-q4_K_S", "8b-23-q4_K_M", "8b-23-q5_K_S", "8b-23-q5_K_M", "8b-23-q6_K"], "image": False}, "mistral": {"url": "https://ollama.com/library/mistral", "tags": ["latest", "7b", "instruct", "text", "v0.1", "v0.2", "v0.3", "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.3-q4_0", "7b-instruct-v0.3-q4_1", "7b-instruct-v0.2-q4_1", "7b-instruct-v0.2-q5_0", "7b-instruct-v0.3-q5_0", "7b-instruct-v0.3-q5_1", "7b-instruct-v0.2-q5_1", "7b-instruct-v0.2-q8_0", "7b-instruct-v0.3-q8_0", "7b-instruct-v0.2-q2_K", "7b-instruct-v0.3-q2_K", "7b-instruct-v0.2-q3_K_S", "7b-instruct-v0.3-q3_K_S", "7b-instruct-v0.3-q3_K_M", "7b-instruct-v0.2-q3_K_M", "7b-instruct-v0.2-q3_K_L", "7b-instruct-v0.3-q3_K_L", "7b-instruct-v0.3-q4_K_S", "7b-instruct-v0.2-q4_K_S", "7b-instruct-v0.3-q4_K_M", "7b-instruct-v0.2-q4_K_M", "7b-instruct-v0.2-q5_K_S", "7b-instruct-v0.3-q5_K_S", "7b-instruct-v0.3-q5_K_M", "7b-instruct-v0.2-q5_K_M", "7b-instruct-v0.2-q6_K", "7b-instruct-v0.3-q6_K", "7b-instruct-v0.3-fp16", "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"], "image": False}, "gemma": {"url": "https://ollama.com/library/gemma", "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-instructLine truncated
available_models = {"llama3": {"url": "https://ollama.com/library/llama3", "tags": [["latest", "4.7GB"], ["70b", "40GB"], ["8b", "4.7GB"], ["instruct", "4.7GB"], ["text", "4.7GB"], ["70b-instruct", "40GB"], ["70b-text", "40GB"], ["70b-instruct-q4_0", "40GB"], ["70b-instruct-q4_1", "44GB"], ["70b-instruct-q5_0", "49GB"], ["70b-instruct-q5_1", "53GB"], ["70b-instruct-q8_0", "75GB"], ["70b-instruct-q2_K", "26GB"], ["70b-instruct-q3_K_S", "31GB"], ["70b-instruct-q3_K_M", "34GB"], ["70b-instruct-q3_K_L", "37GB"], ["70b-instruct-q4_K_S", "40GB"], ["70b-instruct-q4_K_M", "43GB"], ["70b-instruct-q5_K_S", "49GB"], ["70b-instruct-q5_K_M", "50GB"], ["70b-instruct-q6_K", "58GB"], ["70b-instruct-fp16", "141GB"], ["70b-text-q4_0", "40GB"], ["70b-text-q4_1", "44GB"], ["70b-text-q5_0", "49GB"], ["70b-text-q5_1", "53GB"], ["70b-text-q8_0", "75GB"], ["70b-text-q2_K", "26GB"], ["70b-text-q3_K_S", "31GB"], ["70b-text-q3_K_M", "34GB"], ["70b-text-q3_K_L", "37GB"], ["70b-text-q4_K_S", "40GB"], ["70b-text-q4_K_M", "43GB"], ["70b-text-q5_K_S", "49GB"], ["70b-text-q5_K_M", "50GB"], ["70b-text-q6_K", "58GB"], ["70b-text-fp16", "141GB"], ["8b-text", "4.7GB"], ["8b-instruct-q4_0", "4.7GB"], ["8b-instruct-q4_1", "5.1GB"], ["8b-instruct-q5_0", "5.6GB"], ["8b-instruct-q5_1", "6.1GB"], ["8b-instruct-q8_0", "8.5GB"], ["8b-instruct-q2_K", "3.2GB"], ["8b-instruct-q3_K_S", "3.7GB"], ["8b-instruct-q3_K_M", "4.0GB"], ["8b-instruct-q3_K_L", "4.3GB"], ["8b-instruct-q4_K_S", "4.7GB"], ["8b-instruct-q4_K_M", "4.9GB"], ["8b-instruct-q5_K_S", "5.6GB"], ["8b-instruct-q5_K_M", "5.7GB"], ["8b-instruct-q6_K", "6.6GB"], ["8b-instruct-fp16", "16GB"], ["8b-text-q4_0", "4.7GB"], ["8b-text-q4_1", "5.1GB"], ["8b-text-q5_0", "5.6GB"], ["8b-text-q5_1", "6.1GB"], ["8b-text-q8_0", "8.5GB"], ["8b-text-q2_K", "3.2GB"], ["8b-text-q3_K_S", "3.7GB"], ["8b-text-q3_K_M", "4.0GB"], ["8b-text-q3_K_L", "4.3GB"], ["8b-text-q4_K_S", "4.7GB"], ["8b-text-q4_K_M", "4.9GB"], ["8b-text-q5_K_S", "5.6GB"], ["8b-text-q5_K_M", "5.7GB"], ["8b-text-q6_K", "6.6GB"], ["8b-text-fp16", "16GB"]], "image": False}, "phi3": {"url": "https://ollama.com/library/phi3", "tags": [["latest", "2.4GB"], ["14b", "7.9GB"], ["3.8b", "2.4GB"], ["instruct", "2.4GB"], ["medium", "7.9GB"], ["mini", "2.4GB"], ["14b-instruct", "7.9GB"], ["14b-medium-128k-instruct-f16", "28GB"], ["14b-medium-4k-instruct-f16", "28GB"], ["14b-medium-128k-instruct-q4_0", "7.9GB"], ["14b-medium-4k-instruct-q4_0", "7.9GB"], ["14b-medium-128k-instruct-q4_1", "8.8GB"], ["14b-medium-4k-instruct-q4_1", "8.8GB"], ["14b-medium-128k-instruct-q5_0", "9.6GB"], ["14b-medium-4k-instruct-q5_0", "9.6GB"], ["14b-medium-4k-instruct-q5_1", "10GB"], ["14b-medium-128k-instruct-q5_1", "10GB"], ["14b-medium-4k-instruct-q8_0", "15GB"], ["14b-medium-4k-instruct-q2_K", "5.1GB"], ["14b-medium-128k-instruct-q2_K", "5.1GB"], ["14b-medium-128k-instruct-q3_K_S", "6.1GB"], ["14b-medium-4k-instruct-q3_K_S", "6.1GB"], ["14b-medium-4k-instruct-q3_K_M", "6.9GB"], ["14b-medium-128k-instruct-q3_K_M", "6.9GB"], ["14b-medium-128k-instruct-q3_K_L", "7.5GB"], ["14b-medium-4k-instruct-q3_K_L", "7.5GB"], ["14b-medium-4k-instruct-q4_K_S", "8.0GB"], ["14b-medium-128k-instruct-q4_K_S", "8.0GB"], ["14b-medium-128k-instruct-q4_K_M", "8.6GB"], ["14b-medium-4k-instruct-q4_K_M", "8.6GB"], ["14b-medium-128k-instruct-q5_K_S", "9.6GB"], ["14b-medium-4k-instruct-q5_K_S", "9.6GB"], ["14b-medium-4k-instruct-q5_K_M", "10GB"], ["14b-medium-128k-instruct-q5_K_M", "10GB"], ["14b-medium-128k-instruct-q6_K", "11GB"], ["14b-medium-4k-instruct-q6_K", "11GB"], ["3.8b-instruct", "2.4GB"], ["3.8b-mini-4k-instruct-f16", "7.6GB"], ["3.8b-mini-4k-instruct-q4_0", "2.2GB"], ["3.8b-mini-4k-instruct-q4_1", "2.4GB"], ["3.8b-mini-4k-instruct-q5_0", "2.6GB"], ["3.8b-mini-4k-instruct-q5_1", "2.9GB"], ["3.8b-mini-4k-instruct-q8_0", "4.1GB"], ["3.8b-mini-4k-instruct-q2_K", "1.4GB"], ["3.8b-mini-4k-instruct-q3_K_S", "1.7GB"], ["3.8b-mini-4k-instruct-q3_K_M", "2.0GB"], ["3.8b-mini-4k-instruct-q3_K_L", "2.1GB"], ["3.8b-mini-4k-instruct-q4_K_S", "2.2GB"], ["3.8b-mini-instruct-4k-q4_K_M", "2.3GB"], ["3.8b-mini-4k-instruct-q4_K_M", "2.4GB"], ["3.8b-mini-4k-instruct-q5_K_S", "2.6GB"], ["3.8b-mini-4k-instruct-q5_K_M", "2.8GB"], ["3.8b-mini-4k-instruct-q6_K", "3.1GB"], ["3.8b-mini-instruct-4k-fp16", "7.6GB"], ["medium-128k", "7.9GB"], ["3.8-mini-128k-instruct-f16", "7.6GB"], ["3.8-mini-128k-instruct-q4_0", "2.2GB"], ["3.8-mini-128k-instruct-q4_1", "2.4GB"], ["3.8-mini-128k-instruct-q5_0", "2.6GB"], ["3.8-mini-128k-instruct-q5_1", "2.9GB"], ["3.8-mini-128k-instruct-q8_0", "4.1GB"], ["3.8-mini-128k-instruct-q2_K", "1.4GB"], ["3.8-mini-128k-instruct-q3_K_S", "1.7GB"], ["3.8-mini-128k-instruct-q3_K_M", "2.0GB"], ["3.8-mini-128k-instruct-q3_K_L", "2.1GB"], ["3.8-mini-128k-instruct-q4_K_S", "2.2GB"], ["3.8-mini-128k-instruct-q4_K_M", "2.4GB"], ["3.8-mini-128k-instruct-q5_K_S", "2.6GB"], ["3.8-mini-128k-instruct-q5_K_M", "2.8GB"], ["3.8-mini-128k-instruct-q6_K", "3.1GB"]], "image": False}, "aya": {"url": "https://ollama.com/lLine truncated
+2 -2
View File
@@ -148,13 +148,13 @@ def delete_model(self, model_name):
def pull_model_response(self, dialog, task, model_name, tag_drop_down):
if dialog.choose_finish(task) == "pull":
model = f"{model_name}:{tag_drop_down.get_selected_item().get_string()}"
model = f"{model_name}:{tag_drop_down.get_selected_item().get_string().split(' | ')[0]}"
self.pull_model(model)
def pull_model(self, model_name):
tag_list = Gtk.StringList()
for tag in available_models[model_name]['tags']:
tag_list.append(tag)
tag_list.append(f"{tag[0]} | {tag[1]}")
tag_drop_down = Gtk.DropDown(
enable_search=True,
model=tag_list
+10 -4
View File
@@ -540,7 +540,9 @@ class AlpacaWindow(Adw.ApplicationWindow):
def pull_model_update(self, data, model_name):
if model_name in list(self.pulling_models.keys()):
GLib.idle_add(self.pulling_models[model_name].set_subtitle, data['status'] + (f" | {round(data['completed'] / data['total'] * 100, 2)}%" if 'completed' in data and 'total' in data else ""))
GLib.idle_add(self.pulling_models[model_name]['row'].set_subtitle, data['status'])
if 'completed' in data and 'total' in data: GLib.idle_add(self.pulling_models[model_name]['progress_bar'].set_fraction, (data['completed'] / data['total']))
else: GLib.idle_add(self.pulling_models[model_name]['progress_bar'].pulse)
else:
if len(list(self.pulling_models.keys())) == 0:
GLib.idle_add(self.pulling_model_list_box.set_visible, False)
@@ -577,7 +579,10 @@ class AlpacaWindow(Adw.ApplicationWindow):
title = model
)
thread = threading.Thread(target=self.pull_model_process, kwargs={"model": model})
self.pulling_models[model] = model_row
progress_bar = Gtk.ProgressBar(
valign = 3,
show_text = True
)
button = Gtk.Button(
icon_name = "media-playback-stop-symbolic",
vexpand = False,
@@ -585,7 +590,9 @@ class AlpacaWindow(Adw.ApplicationWindow):
css_classes = ["error"]
)
button.connect("clicked", lambda button, model_name=model : dialogs.stop_pull_model(self, model_name))
model_row.add_suffix(progress_bar)
model_row.add_suffix(button)
self.pulling_models[model] = {"row": model_row, "progress_bar": progress_bar}
self.pulling_model_list_box.append(model_row)
thread.start()
@@ -699,12 +706,11 @@ class AlpacaWindow(Adw.ApplicationWindow):
def new_chat(self, chat_name):
chat_name = self.generate_numbered_chat_name(chat_name)
self.chats["chats"][chat_name] = {"messages": []}
#self.chats["selected_chat"] = chat_name
self.save_history()
self.new_chat_element(chat_name, True)
def stop_pull_model(self, model_name):
self.pulling_models[model_name].get_parent().remove(self.pulling_models[model_name])
self.pulling_models[model_name]['row'].get_parent().remove(self.pulling_models[model_name]['row'])
del self.pulling_models[model_name]
def delete_model(self, model_name):