Replaced model description with a button to open Ollama's website for the model
This commit is contained in:
parent
ce427feee4
commit
26bc4fe37f
File diff suppressed because one or more lines are too long
@ -21,7 +21,7 @@ import gi
|
|||||||
gi.require_version('GtkSource', '5')
|
gi.require_version('GtkSource', '5')
|
||||||
gi.require_version('GdkPixbuf', '2.0')
|
gi.require_version('GdkPixbuf', '2.0')
|
||||||
from gi.repository import Adw, Gtk, Gdk, GLib, GtkSource, Gio, GdkPixbuf
|
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 io import BytesIO
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -511,17 +511,24 @@ class AlpacaWindow(Adw.ApplicationWindow):
|
|||||||
self.available_model_list_box.remove_all()
|
self.available_model_list_box.remove_all()
|
||||||
for name, model_info in available_models.items():
|
for name, model_info in available_models.items():
|
||||||
model = Adw.ActionRow(
|
model = Adw.ActionRow(
|
||||||
title = name,
|
title = name
|
||||||
subtitle = model_info['description'],
|
|
||||||
)
|
)
|
||||||
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",
|
icon_name = "folder-download-symbolic",
|
||||||
vexpand = False,
|
vexpand = False,
|
||||||
valign = 3,
|
valign = 3,
|
||||||
css_classes = ["accent"]
|
css_classes = ["accent"]
|
||||||
)
|
)
|
||||||
button.connect("clicked", lambda button=button, model_name=name: self.model_pull_button_activate(model_name))
|
link_button.connect("clicked", lambda button=link_button, link=model_info["url"]: webbrowser.open(link))
|
||||||
model.add_suffix(button)
|
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)
|
self.available_model_list_box.append(model)
|
||||||
|
|
||||||
def manage_models_button_activate(self, button=None):
|
def manage_models_button_activate(self, button=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user