def _get_config_with_export_list( self, task_class: Type[NewTask], model_class: Type[Model], test_file_metadata: TestFileMetadata, ) -> PyTextConfig: return PyTextConfig( task=task_class.Config( data=Data.Config( source=TSVDataSource.Config( train_filename=test_file_metadata.filename, eval_filename=test_file_metadata.filename, test_filename=test_file_metadata.filename, field_names=test_file_metadata.field_names, ), batcher=PoolingBatcher.Config(train_batch_size=1, test_batch_size=1), ), trainer=TaskTrainer.Config(epochs=1), model=model_class.Config( inputs=type(model_class.Config.inputs)( dense=FloatListTensorizer.Config( column=test_file_metadata.dense_col_name, error_check=True, dim=test_file_metadata.dense_feat_dim, ))), ), use_tensorboard=False, use_cuda_if_available=False, export=ExportConfig( export_torchscript_path="/tmp/model_torchscript.pt"), version=LATEST_VERSION, )
def _get_pytext_config( self, test_file_name: TestFileName, task_class: Type[NewTask], model_class: Type[Model], ) -> PyTextConfig: test_file_metadata = get_test_file_metadata(test_file_name) return PyTextConfig( task=task_class.Config( data=Data.Config( source=TSVDataSource.Config( train_filename=test_file_metadata.filename, eval_filename=test_file_metadata.filename, test_filename=test_file_metadata.filename, field_names=test_file_metadata.field_names, ), batcher=Batcher.Config( ), # Use Batcher to avoid shuffling. ), trainer=TaskTrainer.Config(epochs=1), model=model_class.Config( inputs=type(model_class.Config.inputs)( dense=FloatListTensorizer.Config( column=test_file_metadata.dense_col_name, dim=test_file_metadata.dense_feat_dim, ))), ), use_tensorboard=False, use_cuda_if_available=False, version=LATEST_VERSION, )
class Config(ConfigBase): data: Data.Config = Data.Config() trainer: TaskTrainer.Config = TaskTrainer.Config() # TODO: deprecate this use_elastic: Optional[bool] = None
class Config(ConfigBase): data: Data.Config = Data.Config() trainer: TaskTrainer.Config = TaskTrainer.Config()
class Config(ConfigBase): data: Data.Config = Data.Config() trainer: TaskTrainer.Config = TaskTrainer.Config() use_elastic: Optional[bool] = None