Replaced model description with a button to open Ollama's website for the model

This commit is contained in:
jeffser committed 2024-05-20 16:29:48 -06:00
1 parent ce427feee4
commit 26bc4fe37f
2 files changed
+14 -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": {"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
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-q6_K", "8b-text-fp16"]}, "phi3": {"url": "https://ollama.com/library/phi3", "tags": ["latest", "3.8b", "instruct", "mini", "3.8b-mini-instruct-4k-q4_K_M", "3.8b-mini-instruct-4k-fp16"]}, "wizardlm2": {"url": "https://ollama.com/library/wizardlm2", "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": {"url": "https://ollama.com/library/mistral", "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": {"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-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-instruct-q6_K", "2b-instruct-fp16", "2b-text-q4_0", "2b-text-q4_1", "2b-text-q5_0", "2b-text-q5_1", "2b-text-q8_0", "2b-text-q2_K", "2b-text-q3_K_S", "2b-text-q3_K_M", "2b-text-q3_K_L", "2b-text-q4_K_S", "2b-text-q4_K_M", "2b-text-q5_K_S", "2b-text-q5_K_M", "2b-text-q6_K", "2b-text-fp16", "2b-instruct-v1.1-q4_0", "2b-instruct-v1.1-q4_Line truncated
+13 -6
View File
@@ -21,7 +21,7 @@ import gi
gi.require_version('GtkSource', '5')
gi.require_version('GdkPixbuf', '2.0')
from gi.repository import Adw, Gtk, Gdk, GLib, GtkSource, Gio, GdkPixbuf
import json, requests, threading, os, re, base64, sys, gettext, locale
import json, requests, threading, os, re, base64, sys, gettext, locale, webbrowser
from io import BytesIO
from PIL import Image
from datetime import datetime
@@ -511,17 +511,24 @@ class AlpacaWindow(Adw.ApplicationWindow):
self.available_model_list_box.remove_all()
for name, model_info in available_models.items():
model = Adw.ActionRow(
title = name,
subtitle = model_info['description'],
title = name
)
button = Gtk.Button(
link_button = Gtk.Button(
icon_name = "web-browser-symbolic",
vexpand = False,
valign = 3,
css_classes = ["success"]
)
pull_button = Gtk.Button(
icon_name = "folder-download-symbolic",
vexpand = False,
valign = 3,
css_classes = ["accent"]
)
button.connect("clicked", lambda button=button, model_name=name: self.model_pull_button_activate(model_name))
model.add_suffix(button)
link_button.connect("clicked", lambda button=link_button, link=model_info["url"]: webbrowser.open(link))
pull_button.connect("clicked", lambda button=pull_button, model_name=name: self.model_pull_button_activate(model_name))
model.add_suffix(link_button)
model.add_suffix(pull_button)
self.available_model_list_box.append(model)
def manage_models_button_activate(self, button=None):