model
superduper.components.model
init_decorator
init_decorator(func)
Parameter | Description |
---|---|
func | init function. |
Decorator to set _is_setup to True
after init method is called.
method_wrapper
method_wrapper(method,
item,
signature: 'str')
Parameter | Description |
---|---|
method | Method to execute. |
item | Item to wrap. |
signature | Signature of the method. |
Wrap the item with the model.
serve
serve(f)
Parameter | Description |
---|---|
f | Method to serve. |
Decorator to serve the model on the associated cluster.
APIBaseModel
APIBaseModel(self,
identifier: str,
upstream: Optional[List[ForwardRef('Component')]] = None,
db: dataclasses.InitVar[typing.Optional[ForwardRef('Datalayer')]] = None,
*,
compute_kwargs: 't.Dict' = <factory>,
datatype: 'str | None' = None,
model_update_kwargs: 't.Dict' = <factory>,
predict_kwargs: 't.Dict' = <factory>,
validation: 't.Optional[Validation]' = None,
metric_values: 't.Dict' = <factory>,
num_workers: 'int' = 0,
serve: 'bool' = False,
trainer: 't.Optional[Trainer]' = None,
model: 't.Optional[str]' = None,
max_batch_size: 'int' = 8,
postprocess: 't.Optional[t.Callable]' = None) -> None
Parameter | Description |
---|---|
identifier | Identifier of the instance. |
upstream | A list of upstream components. |
compute_kwargs | Kwargs used for compute backend job submit. Example (Ray backend): compute_kwargs = dict(resources=...). |
db | Datalayer instance. Datalayer instance. |
datatype | DataType instance. |
model_update_kwargs | The kwargs to use for model update. |
predict_kwargs | Additional arguments to use at prediction time. |
validation | The validation Dataset instances to use. |
metric_values | The metrics to evaluate on. |
num_workers | Number of workers to use for parallel prediction. |
serve | Creates an http endpoint and serve the model with compute_kwargs on a distributed cluster. |
trainer | Trainer instance to use for training. |
model | The Model to use, e.g. 'text-embedding-ada-002' |
max_batch_size | Maximum batch size. |
postprocess | Postprocess function to use on the output of the API request |
APIBaseModel component which is used to make the type of API request.