fix: Embeddings not being sorted alphabetically

This commit is contained in:
blessedcoolant 2023-07-26 20:34:14 +12:00
parent 6fd8543e69
commit 9e9dce44b4

View File

@ -57,6 +57,11 @@ const ParamEmbeddingPopover = (props: Props) => {
}); });
}); });
// Sort Alphabetically
data.sort((a, b) =>
a.label && b.label ? (a.label?.localeCompare(b.label) ? -1 : 1) : -1
);
return data.sort((a, b) => (a.disabled && !b.disabled ? 1 : -1)); return data.sort((a, b) => (a.disabled && !b.disabled ? 1 : -1));
}, [embeddingQueryData, currentMainModel?.base_model]); }, [embeddingQueryData, currentMainModel?.base_model]);