Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
josephrocca authored Jul 21, 2023
1 parent 4654efd commit c7189e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ <h1 style="font-size:1rem;">Sort/search images using OpenAI's CLIP in your brows
<div id="searchCtnEl" style="opacity:0.5; pointer-events:none; padding:0.5rem; background:lightgrey; margin:0.5rem;">
<b>Step 6:</b> Enter a search term.
<br>
<input id="searchTextEl" style="width:300px;" value="" placeholder="Enter search text here..." onkeyup="if(event.which==13) searchSort()">
<button id="searchBtn" onclick="searchSort()">search</button>
<input id="searchTextEl" style="width:500px;" value="" placeholder="Enter search text here..." onkeyup="if(event.which==13) searchSort()">
<button id="searchBtn" onclick="searchSort()">search</button> max results: <input id="maxResultsEl" type="number" value="100" style="width:50px;">
<div id="searchNoteEl" style="font-size:80%;"></div>
</div>
</div>
Expand Down Expand Up @@ -453,7 +453,7 @@ <h1 style="font-size:1rem;">Sort/search images using OpenAI's CLIP in your brows
});
}
}
let similarityEntries = Object.entries(similarities).sort((a,b) => b[1]-a[1]).slice(0, 5000);
let similarityEntries = Object.entries(similarities).sort((a,b) => b[1]-a[1]).slice(0, 10000);

if(dataSource === "reddit" && removeRedditNsfwEl.checked) {
let nsfwTextEmbedding = await modelData[MODEL_NAME].text.embed(atob('cG9ybiBuYWtlZCBwZW5pcyB2YWdpbmEgbnVkZSBzZXggZGljayBwdXNzeSBzZXh1YWwgcG9ybm9ncmFwaGljIGFzcyBib29icw=='), onnxTextSession); // nsfw words (hidden with `btoa`)
Expand All @@ -467,7 +467,7 @@ <h1 style="font-size:1rem;">Sort/search images using OpenAI's CLIP in your brows

let resultHtml = "";
let numResults = 0;
for(let [path, score] of similarityEntries.slice(0, 1000)) {
for(let [path, score] of similarityEntries.slice(0, Number(maxResultsEl.value))) {
if(dataSource === "local") {
let handle = await getFileHandleByPath(path);
let url = URL.createObjectURL(await handle.getFile());
Expand Down

0 comments on commit c7189e2

Please sign in to comment.