1
0
mirror of https://github.com/osmarks/meme-search-engine.git synced 2024-11-13 07:19:54 +00:00

Improved UI for sliders

This commit is contained in:
osmarks 2024-05-22 20:26:23 +01:00
parent d8c147df52
commit 978aadda6a

View File

@ -105,7 +105,7 @@
<span>[embedding loaded from URL]</span>
{/if}
{#if term.type === "predefined_embedding"}
<span>{term.predefinedEmbedding}</span>
<span>{term.sign === "-" ? invertEmbeddingDesc(term.predefinedEmbedding) : term.predefinedEmbedding}</span>
{/if}
</li>
{/each}
@ -185,6 +185,12 @@
predefinedEmbeddingName = "Sliders"
}
const invertEmbeddingDesc = x => {
const [fst, snd] = x.split("/")
if (snd === undefined) return "Not " + fst
return `${snd}/${fst}`
}
const decodeFloat16 = uint16 => {
const sign = (uint16 & 0x8000) ? -1 : 1
const exponent = (uint16 & 0x7C00) >> 10