Spaces:
Runtime error
Runtime error
File size: 1,583 Bytes
105b369 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
from typing import Dict, Any, Optional
from pydantic import BaseModel
class Ivfflat(BaseModel):
name: Optional[str] = None
nlist: int = 128 # Number of inverted lists
nprobe: int = 8 # Number of probes at query time
metric_type: str = "EUCLIDEAN_DISTANCE" # Can be "EUCLIDEAN_DISTANCE" or "DOT_PRODUCT"
configuration: Dict[str, Any] = {}
class IvfPQ(BaseModel):
name: Optional[str] = None
nlist: int = 128 # Number of inverted lists
m: int = 32 # Number of subquantizers
nbits: int = 8 # Number of bits per quantization index
nprobe: int = 8 # Number of probes at query time
metric_type: str = "EUCLIDEAN_DISTANCE" # Can be "EUCLIDEAN_DISTANCE" or "DOT_PRODUCT"
configuration: Dict[str, Any] = {}
class HNSWFlat(BaseModel):
name: Optional[str] = None
M: int = 30 # Number of neighbors
ef_construction: int = 200 # Expansion factor at construction time
ef_search: int = 200 # Expansion factor at search time
metric_type: str = "EUCLIDEAN_DISTANCE" # Can be "EUCLIDEAN_DISTANCE" or "DOT_PRODUCT"
configuration: Dict[str, Any] = {}
class HNSWPQ(BaseModel):
name: Optional[str] = None
M: int = 30 # Number of neighbors
ef_construction: int = 200 # Expansion factor at construction time
m: int = 4 # Number of sub-quantizers
nbits: int = 8 # Number of bits per quantization index
ef_search: int = 200 # Expansion factor at search time
metric_type: str = "EUCLIDEAN_DISTANCE" # Can be "EUCLIDEAN_DISTANCE" or "DOT_PRODUCT"
configuration: Dict[str, Any] = {}
|