Adapters#

This module define a module to adapt model weights from a data source.

class otx.api.usecases.adapters.model_adapter.ExportableCodeAdapter(data_source: Union[IDataSource, bytes])#

Adapter intended to lazily fetch raw exportable code data from a given data source.

class otx.api.usecases.adapters.model_adapter.IDataSource#

Class that holds a combination of both a repo and a URL which can be used to fetch data.

abstract property data#

Returns the data of the source.

class otx.api.usecases.adapters.model_adapter.ModelAdapter(data_source: Union[IDataSource, bytes])#

The ModelAdapter is an adapter is intended to lazily fetch its binary data from a given data source.

property data#

Returns the data of the Model.

property data_source#

Returns the data source of the adapter.

property from_file_storage: bool#

Returns if the ModelAdapters data comes from the file storage or not.

This is used in the model repo to know if the data of the model should be saved or not.