Support png embeddings

Fixes #33
This commit is contained in:
Dominik Reh
2022-10-24 14:01:44 +02:00
parent 4af8d5285d
commit e8cf50cdaa
2 changed files with 2 additions and 2 deletions

View File

@@ -599,7 +599,7 @@ onUiUpdate(function () {
try {
embeddings = readFile("file/tags/temp/emb.txt").split("\n")
.filter(x => x.trim().length > 0) // Remove empty lines
.map(x => x.replace(".bin", "").replace(".pt", "")); // Remove file extensions
.map(x => x.replace(".bin", "").replace(".pt", "").replace(".png", "")); // Remove file extensions
} catch (e) {
console.error("Error loading embeddings.txt: " + e);
}

View File

@@ -20,7 +20,7 @@ def get_wildcards():
def get_embeddings():
"""Returns a list of all embeddings"""
return [str(e.relative_to(EMB_PATH)) for e in EMB_PATH.glob("**/*") if e.suffix in {".bin", ".pt"}]
return [str(e.relative_to(EMB_PATH)) for e in EMB_PATH.glob("**/*") if e.suffix in {".bin", ".pt", ".png"}]
def write_to_temp_file(name, data):