![]() |
Base DataLoader class for Searcher task.
tflite_model_maker.searcher.DataLoader(
embedder_path: Optional[str] = None,
dataset: Optional[np.ndarray] = None,
metadata: Optional[List[AnyStr]] = None
) -> None
Args | |
---|---|
embedder_path
|
Path to the TFLite Embedder model file. |
dataset
|
Embedding dataset used to build on-device ScaNN index file. The
dataset shape should be (dataset_size, embedding_dim). If None,
dataset will be generated from raw input data later.
|
metadata
|
The metadata for each data in the dataset. The length of
metadata should be same as dataset and passed in the same order as
dataset . If dataset is set, metadata should be set as well.
|
Attributes | |
---|---|
dataset
|
Gets the dataset.
Due to performance consideration, we don't return a copy, but the returned
|
embedder_path
|
Gets the path to the TFLite Embedder model file. |
metadata
|
Gets the metadata. |
Methods
append
append(
data_loader: 'DataLoader'
) -> None
Appends the dataset.
Don't check if embedders from the two data loader are the same in this function. Users are responsible to keep the embedder identical.
Args | |
---|---|
data_loader
|
The data loader in which the data will be appended. |
__len__
__len__()