Added description to model list and change it to JSON file

This commit is contained in:
jeffser committed 2024-06-25 00:36:02 -06:00
1 parent 8bf8ca1b90
commit ce3dce4c67
7 files changed
+9 -18

No files matched your search

-1
View File
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/com/jeffser/Alpaca">
<file>style.css</file>
<file alias="icons/scalable/status/library-symbolic.svg">icons/library-symbolic.svg</file>
<file alias="icons/scalable/status/paper-plane-symbolic.svg">icons/paper-plane-symbolic.svg</file>
<file alias="icons/scalable/status/globe-symbolic.svg">icons/globe-symbolic.svg</file>
+1
View File
@@ -0,0 +1 @@
{"llama3": {"url": "https://ollama.com/library/llama3", "description": "Meta Llama 3: The most capable openly available LLM to date", "tags": [["latest", "4.7GB"], ["70b", "40GB"], ["8b", "4.7GB"], ["instruct", "4.7GB"], ["text", "4.7GB"], ["70b-instruct", "40GB"], ["70b-instruct-fp16", "141GB"], ["70b-instruct-q2_K", "26GB"], ["70b-instruct-q3_K_L", "37GB"], ["70b-instruct-q3_K_M", "34GB"], ["70b-instruct-q3_K_S", "31GB"], ["70b-instruct-q4_0", "40GB"], ["70b-instruct-q4_1", "44GB"], ["70b-instruct-q4_K_M", "43GB"], ["70b-instruct-q4_K_S", "40GB"], ["70b-instruct-q5_0", "49GB"], ["70b-instruct-q5_1", "53GB"], ["70b-instruct-q5_K_M", "50GB"], ["70b-instruct-q5_K_S", "49GB"], ["70b-instruct-q6_K", "58GB"], ["70b-instruct-q8_0", "75GB"], ["70b-text", "40GB"], ["70b-text-fp16", "141GB"], ["70b-text-q2_K", "26GB"], ["70b-text-q3_K_L", "37GB"], ["70b-text-q3_K_M", "34GB"], ["70b-text-q3_K_S", "31GB"], ["70b-text-q4_0", "40GB"], ["70b-text-q4_1", "44GB"], ["70b-text-q4_K_M", "43GB"], ["70b-text-q4_K_S", "40GB"], ["70b-text-q5_0", "49GB"], ["70b-text-q5_1", "53GB"], ["70b-text-q5_K_M", "50GB"], ["70b-text-q5_K_S", "49GB"], ["70b-text-q6_K", "58GB"], ["70b-text-q8_0", "75GB"], ["8b-instruct-fp16", "16GB"], ["8b-instruct-q2_K", "3.2GB"], ["8b-instruct-q3_K_L", "4.3GB"], ["8b-instruct-q3_K_M", "4.0GB"], ["8b-instruct-q3_K_S", "3.7GB"], ["8b-instruct-q4_0", "4.7GB"], ["8b-instruct-q4_1", "5.1GB"], ["8b-instruct-q4_K_M", "4.9GB"], ["8b-instruct-q4_K_S", "4.7GB"], ["8b-instruct-q5_0", "5.6GB"], ["8b-instruct-q5_1", "6.1GB"], ["8b-instruct-q5_K_M", "5.7GB"], ["8b-instruct-q5_K_S", "5.6GB"], ["8b-instruct-q6_K", "6.6GB"], ["8b-instruct-q8_0", "8.5GB"], ["8b-text", "4.7GB"], ["8b-text-fp16", "16GB"], ["8b-text-q2_K", "3.2GB"], ["8b-text-q3_K_L", "4.3GB"], ["8b-text-q3_K_M", "4.0GB"], ["8b-text-q3_K_S", "3.7GB"], ["8b-text-q4_0", "4.7GB"], ["8b-text-q4_1", "5.1GB"], ["8b-text-q4_K_M", "4.9GB"], ["8b-text-q4_K_S", "4.7GB"], ["8b-text-q5_0", "5.6GB"], ["8b-text-q5_1", "6.1GB"], ["8b-text-q5_K_M", "5.7GB"], ["8b-text-q5_K_S", "5.6GB"], ["8b-text-q6_K", "6.6GB"], ["8b-text-q8_0", "8.5GB"]], "image": false}, "qwen2": {"url": "https://ollama.com/library/qwen2", "description": "Qwen2 is a new series of large language models from Alibaba group", "tags": [["latest", "4.4GB"], ["72b", "41GB"], ["7b", "4.4GB"], ["1.5b", "935MB"], ["0.5b", "352MB"], ["72b-instruct", "41GB"], ["72b-instruct-fp16", "145GB"], ["72b-instruct-q2_K", "30GB"], ["72b-instruct-q3_K_L", "40GB"], ["72b-instruct-q3_K_M", "38GB"], ["72b-instruct-q3_K_S", "34GB"], ["72b-instruct-q4_0", "41GB"], ["72b-instruct-q4_1", "46GB"], ["72b-instruct-q4_K_M", "47GB"], ["72b-instruct-q4_K_S", "44GB"], ["72b-instruct-q5_0", "50GB"], ["72b-instruct-q5_1", "55GB"], ["72b-instruct-q5_K_M", "54GB"], ["72b-instruct-q5_K_S", "51GB"], ["72b-instruct-q6_K", "64GB"], ["72b-instruct-q8_0", "77GB"], ["72b-text", "41GB"], ["72b-text-fp16", "145GB"], ["72b-text-q2_K", "30GB"], ["72b-text-q3_K_L", "40GB"], ["72b-text-q3_K_M", "38GB"], ["72b-text-q3_K_S", "34GB"], ["72b-text-q4_0", "41GB"], ["72b-text-q4_1", "46GB"], ["72b-text-q4_K_M", "47GB"], ["72b-text-q4_K_S", "44GB"], ["72b-text-q5_0", "50GB"], ["72b-text-q5_1", "55GB"], ["72b-text-q5_K_M", "54GB"], ["72b-text-q5_K_S", "51GB"], ["72b-text-q6_K", "64GB"], ["72b-text-q8_0", "77GB"], ["7b-instruct", "4.4GB"], ["7b-instruct-fp16", "15GB"], ["7b-instruct-q2_K", "3.0GB"], ["7b-instruct-q3_K_L", "4.1GB"], ["7b-instruct-q3_K_M", "3.8GB"], ["7b-instruct-q3_K_S", "3.5GB"], ["7b-instruct-q4_0", "4.4GB"], ["7b-instruct-q4_1", "4.9GB"], ["7b-instruct-q4_K_M", "4.7GB"], ["7b-instruct-q4_K_S", "4.5GB"], ["7b-instruct-q5_0", "5.3GB"], ["7b-instruct-q5_1", "5.8GB"], ["7b-instruct-q5_K_M", "5.4GB"], ["7b-instruct-q5_K_S", "5.3GB"], ["7b-instruct-q6_K", "6.3GB"], ["7b-instruct-q8_0", "8.1GB"], ["7b-text", "4.4GB"], ["7b-text-q2_K", "3.0GB"], ["7b-text-q3_K_L", "4.1GB"], ["7b-text-q3_K_M", "3.8GB"], ["7b-text-q3_K_S", "3.5GB"], ["7b-text-q4_0", "4.4GB"], ["7b-text-q4_1", "4.9GB"], ["7b-text-q4_K_M", "4.7GB"], ["7b-text-q4_K_S", "4.5GB"], ["7b-text-q5_0", "5.3GB"], ["7b-text-q5_1", "5.8GB"], ["7b-text-q8_0", "8.1GB"], ["1.5b-instruct", "935MB"], ["1.5b-instruct-fp16", "3.1GB"], ["1.5b-instruct-q2_K", "676MB"], ["1.5b-instruct-q3_K_L", "880MB"], ["1.5b-instruct-q3_K_M", "824MB"], ["1.5b-instruct-q3_K_S", "761MB"], ["1.5b-instruct-q4_0", "935MB"], ["1.5b-instruct-q4_1", "1.0GB"], ["1.5b-instruct-q4_K_M", "986MB"], ["1.5b-instruct-q4_K_S", "940MB"], ["1.5b-instruct-q5_0", "1.1GB"], ["1.5b-instruct-q5_1", "1.2GB"], ["1.5b-instruct-q5_K_M", "1.1GB"], ["1.5b-instruct-q5_K_S", "1.1GB"], ["1.5b-instruct-q6_K", "1.3GB"], ["1.5b-instruct-q8_0", "1.6GB"], ["0.5b-instruct", "352MB"], ["0.5b-instruct-fp16", "994MB"], ["0.5b-instruct-q2_K", "339MB"], ["0.5b-instruct-q3_K_L", "369MB"], ["0.5b-instruct-q3_K_M", "355MB"], ["0.5b-instruct-q3_K_S", "338MB"], ["0.5b-instruct-q4_0", "352MB"], ["0.5b-instruct-q4_1", "375MB"], ["0.5b-instruct-q4_K_M", "398MB"], ["0.5b-instruct-q4Line truncated
-3
View File
@@ -1,3 +0,0 @@
# available_models.py
# There's no API for this, sorry
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
+1 -2
View File
@@ -1,7 +1,6 @@
# dialogs.py
from gi.repository import Adw, Gtk, Gdk, GLib, GtkSource, Gio, GdkPixbuf
from .available_models import available_models
# CLEAR CHAT | WORKS
@@ -153,7 +152,7 @@ def pull_model_response(self, dialog, task, model_name, tag_drop_down):
def pull_model(self, model_name):
tag_list = Gtk.StringList()
for tag in available_models[model_name]['tags']:
for tag in self.available_models[model_name]['tags']:
tag_list.append(f"{tag[0]} | {tag[1]}")
tag_drop_down = Gtk.DropDown(
enable_search=True,
+2 -2
View File
@@ -40,10 +40,10 @@ alpaca_sources = [
'main.py',
'window.py',
'connection_handler.py',
'available_models.py',
'dialogs.py',
'local_instance.py',
'update_history.py'
'update_history.py',
'available_models.json'
]
install_data(alpaca_sources, install_dir: moduledir)
-7
View File
@@ -1,7 +0,0 @@
.message .delete-message-button {
opacity: 0;
transition: opacity .05s;
}
.message:hover .delete-message-button {
opacity: 1;
}
+5 -3
View File
@@ -28,7 +28,6 @@ from io import BytesIO
from PIL import Image
from pypdf import PdfReader
from datetime import datetime
from .available_models import available_models
from . import dialogs, local_instance, connection_handler, update_history
@Gtk.Template(resource_path='/com/jeffser/Alpaca/window.ui')
@@ -48,6 +47,7 @@ class AlpacaWindow(Adw.ApplicationWindow):
_ = gettext.gettext
#Variables
available_models = None
run_on_background = False
remote_url = ""
run_remote = False
@@ -861,10 +861,10 @@ class AlpacaWindow(Adw.ApplicationWindow):
def update_list_available_models(self):
self.available_model_list_box.remove_all()
for name, model_info in available_models.items():
for name, model_info in self.available_models.items():
model = Adw.ActionRow(
title = name,
subtitle = "Image recognition" if model_info["image"] else None
subtitle = (_("(Image recognition capable)\n") if model_info["image"] else "") + model_info['description']
)
link_button = Gtk.Button(
icon_name = "globe-symbolic",
@@ -1271,6 +1271,8 @@ class AlpacaWindow(Adw.ApplicationWindow):
def __init__(self, **kwargs):
super().__init__(**kwargs)
GtkSource.init()
with open('/app/share/Alpaca/alpaca/available_models.json', 'r') as f:
self.available_models = json.load(f)
if not os.path.exists(os.path.join(self.data_dir, "chats")):
os.makedirs(os.path.join(self.data_dir, "chats"))
if os.path.exists(os.path.join(self.config_dir, "chats.json")) and not os.path.exists(os.path.join(self.data_dir, "chats", "chats.json")):