pixano_inference.pydantic.data.vector_database
Pydantic model for the Vector databases.
LanceVector
Bases: BaseModel
Lance vector model.
Attributes:
Name | Type | Description |
---|---|---|
path |
str
|
The path to the LANCE dataset. |
column |
str
|
The column to read. |
indice |
int | None
|
The index of the row to read. |
where |
str | None
|
The filter to apply. If specified, only one row should be returned. |
shape |
list[int] | None
|
The shape of the vector. |
read_vector(return_type='tensor')
Reads a vector from a Lance dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
return_type
|
Literal['tensor', 'numpy']
|
The type of the return value. Either 'tensor' or 'numpy'. |
'tensor'
|
Returns:
Type | Description |
---|---|
'Tensor' | ndarray
|
The vector. |
Source code in pixano_inference/pydantic/data/vector_database.py
validate_indice_or_where()
Validates that only one of 'indice' and 'where' is specified.