1
0
mirror of https://github.com/osmarks/meme-search-engine.git synced 2024-11-13 23:34:49 +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> <span>[embedding loaded from URL]</span>
{/if} {/if}
{#if term.type === "predefined_embedding"} {#if term.type === "predefined_embedding"}
<span>{term.predefinedEmbedding}</span> <span>{term.sign === "-" ? invertEmbeddingDesc(term.predefinedEmbedding) : term.predefinedEmbedding}</span>
{/if} {/if}
</li> </li>
{/each} {/each}
@ -185,6 +185,12 @@
predefinedEmbeddingName = "Sliders" predefinedEmbeddingName = "Sliders"
} }
const invertEmbeddingDesc = x => {
const [fst, snd] = x.split("/")
if (snd === undefined) return "Not " + fst
return `${snd}/${fst}`
}
const decodeFloat16 = uint16 => { const decodeFloat16 = uint16 => {
const sign = (uint16 & 0x8000) ? -1 : 1 const sign = (uint16 & 0x8000) ? -1 : 1
const exponent = (uint16 & 0x7C00) >> 10 const exponent = (uint16 & 0x7C00) >> 10