mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-02-05 07:40:09 +00:00
Fix embeddings not at top
(only affecting the "include embeddings in normal results" option)
This commit is contained in:
@@ -1158,8 +1158,14 @@ async function autocomplete(textArea, prompt, fixedTag = null) {
|
||||
const aUseStats = counts.find(c => c.name === aName && c.type === a.type);
|
||||
const bUseStats = counts.find(c => c.name === bName && c.type === b.type);
|
||||
|
||||
const aWeight = calculateUsageBias(a.count || 0, aUseStats ? aUseStats.count : 0);
|
||||
const bWeight = calculateUsageBias(b.count || 0, bUseStats ? bUseStats.count : 0);
|
||||
let aNoCountFallback = 0;
|
||||
let bNoCountFallback = 0;
|
||||
if (TAC_CFG.includeEmbeddingsInNormalResults) {
|
||||
aNoCountFallback = a.type === ResultType.embedding ? Infinity : 0;
|
||||
bNoCountFallback = b.type === ResultType.embedding ? Infinity : 0;
|
||||
}
|
||||
const aWeight = calculateUsageBias(a.count || aNoCountFallback, aUseStats ? aUseStats.count : 0);
|
||||
const bWeight = calculateUsageBias(b.count || bNoCountFallback, bUseStats ? bUseStats.count : 0);
|
||||
|
||||
return bWeight - aWeight;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user