Show thumbnails for embeddings

This commit is contained in:
cmdr2 2023-08-17 12:26:23 +05:30
parent 7ee1d3cd91
commit a2479b74be
2 changed files with 11 additions and 11 deletions

View File

@ -694,9 +694,9 @@
<label for="embedding-card-size-selector"><small>Thumbnail Size:</small></label>
<select id="embedding-card-size-selector" name="embedding-card-size-selector">
<option value="-2">0</option>
<option value="-1">1</option>
<option value="-1" selected>1</option>
<option value="0">2</option>
<option value="1" selected>3</option>
<option value="1">3</option>
<option value="2">4</option>
<option value="3">5</option>
</select>

View File

@ -2735,16 +2735,16 @@ function updateEmbeddingsList(filter = "") {
let token=m.toLowerCase()
if (token.search(filter) != -1) {
let button
if (iconlist.length==0) {
button = document.createElement("button")
button.innerText = m
} else {
let img = '/media/images/noimg.png'
if (token in embIcon) {
img = `/bucket/${profileName}/embeddings/${embIcon[token]}`
}
button = createModifierCard(m, [img,img], true)
// if (iconlist.length==0) {
// button = document.createElement("button")
// button.innerText = m
// } else {
let img = '/media/images/noimg.png'
if (token in embIcon) {
img = `/bucket/${profileName}/embeddings/${embIcon[token]}`
}
button = createModifierCard(m, [img,img], true)
// }
button.dataset["embedding"] = m
button.addEventListener("click", onButtonClick)
toplevel.appendChild(button)