Skip to main content

model

superduperdb.ext.sentence_transformers.model

Source code

SentenceTransformer​

SentenceTransformer(self,
identifier: str,
db: dataclasses.InitVar[typing.Optional[ForwardRef('Datalayer')]] = None,
uuid: str = <factory>,
*,
preferred_devices: 't.Sequence[str]' = ('cuda',
'mps',
'cpu'),
device: str = 'cpu',
artifacts: 'dc.InitVar[t.Optional[t.Dict]]' = None,
signature: Literal['*args',
'**kwargs',
'*args,
**kwargs',
'singleton'] = 'singleton',
datatype: 'EncoderArg' = None,
output_schema: 't.Optional[Schema]' = None,
flatten: 'bool' = False,
model_update_kwargs: 't.Dict' = <factory>,
predict_kwargs: 't.Dict' = <factory>,
compute_kwargs: 't.Dict' = <factory>,
validation: 't.Optional[Validation]' = None,
metric_values: 't.Dict' = <factory>,
object: Optional[sentence_transformers.SentenceTransformer.SentenceTransformer] = None,
model: Optional[str] = None,
preprocess: Optional[Callable] = None,
postprocess: Optional[Callable] = None) -> None
ParameterDescription
identifierIdentifier of the leaf.
dbDatalayer instance.
uuidUUID of the leaf.
artifactsA dictionary of artifacts paths and DataType objects
signatureThe signature of the model.
datatypeDataType instance.
output_schemaOutput schema (mapping of encoders).
flattenFlatten the model outputs.
model_update_kwargsThe kwargs to use for model update.
predict_kwargsAdditional arguments to use at prediction time.
compute_kwargsKwargs used for compute backend job submit. Example (Ray backend): compute_kwargs = dict(resources=...).
validationThe validation Dataset instances to use.
metric_valuesThe metrics to evaluate on.
objectThe SentenceTransformer object to use.
modelThe model name, e.g. 'all-MiniLM-L6-v2'.
deviceThe device to use, e.g. 'cpu' or 'cuda'.
preprocessThe preprocessing function to apply to the input.
postprocessThe postprocessing function to apply to the output.
preferred_devicesA list of devices to prefer, in that order.

A model for sentence embeddings using sentence-transformers.