mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 21:29:08 +00:00
Rerank Search Results by Default on GPU machines (#668)
- Trigger SentenceTransformer Cross Encoder models now run fast on GPU enabled machines, including Mac ARM devices since UKPLab/sentence-transformers#2463 - Details - Use cross-encoder to rerank search results by default on GPU machines and when using an inference server - Only call search API when pause in typing search query on web, desktop apps
This commit is contained in:
@@ -192,16 +192,17 @@
|
||||
});
|
||||
}
|
||||
|
||||
let debounceTimeout;
|
||||
function incrementalSearch(event) {
|
||||
type = 'all';
|
||||
// Search with reranking on 'Enter'
|
||||
if (event.key === 'Enter') {
|
||||
search(rerank=true);
|
||||
}
|
||||
// Limit incremental search to text types
|
||||
else if (type !== "image") {
|
||||
search(rerank=false);
|
||||
}
|
||||
// Run incremental search only after waitTime passed since the last key press
|
||||
let waitTime = 300;
|
||||
clearTimeout(debounceTimeout);
|
||||
debounceTimeout = setTimeout(() => {
|
||||
type = 'all';
|
||||
// Search with reranking on 'Enter'
|
||||
let should_rerank = event.key === 'Enter';
|
||||
search(rerank=should_rerank);
|
||||
}, waitTime);
|
||||
}
|
||||
|
||||
async function populate_type_dropdown() {
|
||||
|
||||
Reference in New Issue
Block a user