Skip to content

Commit

Permalink
updated thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
metonymic-smokey committed May 21, 2024
1 parent b008b66 commit fc01ed8
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions section_faiss_vector_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,20 +458,12 @@ const (
// Returns a description string for the index and quantizer type
// and an index type.
func determineIndexToUse(nvecs, nlist int, indexOptimizedFor string) (string, int) {
if indexOptimizedFor == index.IndexOptimizedForMemory {
switch {
case nvecs >= 1000:
switch {
case nvecs >= 1000:
if indexOptimizedFor == index.IndexOptimizedForMemory {
return fmt.Sprintf("IVF%d,SQ4", nlist), IndexTypeIVF
default:
return "IDMap2,Flat", IndexTypeFlat
}
}

switch {
case nvecs >= 10000:
return fmt.Sprintf("IVF%d,SQ8", nlist), IndexTypeIVF
case nvecs >= 1000:
return fmt.Sprintf("IVF%d,Flat", nlist), IndexTypeIVF
default:
return "IDMap2,Flat", IndexTypeFlat
}
Expand Down

0 comments on commit fc01ed8

Please sign in to comment.