Guides
Log In
Guides

Training Module REST APIs

Start Session

Start a new session and returns the key.

param force_restart: if != 0, forces restart by wiping current session.
type force_restart: int

return server status dictionary.

raises HTTPException: When there is already an active session.

MethodURL
GET/start_session

Parameters

NameInDescriptionRequired
force_restartqueryOptional
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray

Update Training Config

Update the training config.

param key: session key to check validity.
type key: str
param config: intended configuration for the training process.
type config: TrainingConfigParams

return server status dictionary with a copy of the full config parameters.

raises HTTPException: when trying to configure in a non-setup state.

MethodURL
POST/parameters/{key}

Parameters

NameInDescriptionRequired
keypathRequired
Request Body
FieldTypeDescriptionRequired
modelstringOptional
task_typestringOptional
batch_sizeintegerOptional
epochsintegerOptional
eval_metricsarrayOptional
epochs_per_test_runintegerOptional
learning_ratenumberOptional
seedintegerOptional
init_evalbooleanOptional
cache_dirstringOptional
overwrite_cachebooleanOptional
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray

Return Training Config

Return the training config.

return server status dictionary with configuration params and session key.

raises HTTPException: When there is no active session.

MethodURL
GET/parameters

Parameters

NameInDescriptionRequired
Response (200)
FieldTypeDescription

Preprocess

Perform preprocessing.

param key: session key to check validity.
type key: str

return server status dictionary.

raises HTTPException: when endpoint called and preprocessing is not possible.

MethodURL
POST/preprocess/{key}

Parameters

NameInDescriptionRequired
keypathRequired
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray

Get Preprocess Status

Get the preprocessing status.

return server status dictionary.

MethodURL
GET/preprocess_status

Parameters

NameInDescriptionRequired
Response (200)
FieldTypeDescription

Start Training

Start training.

param key: session key to check validity.
type key: str
param background_task: FastAPI parameter used to perform background tasks.
type background_task: BackgroundTask

return server status dictionary.

raises HTTPException: when endpoint called and training is not possible.

MethodURL
POST/training/start/{key}

Parameters

NameInDescriptionRequired
keypathRequired
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray

Stop Training

Stop training.

param key: session key to check validity.
type key: str
param force_restart: if != 0, forcess restart by wiping current session.
type force_restart: int

return server status dict.

raises HTTPException: when there is no training session.

MethodURL
POST/training/stop/{key}

Parameters

NameInDescriptionRequired
keypathRequired
force_restartqueryOptional
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray

Get Status

Get status.

return server session status.

MethodURL
GET/status

Parameters

NameInDescriptionRequired
Response (200)
FieldTypeDescription

Monitor

Get the last training info.

param key: session key to check validity.
type key: str

return server status dict.

MethodURL
GET/monitor/{key}

Parameters

NameInDescriptionRequired
keypathRequired
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray

Upload Dataset

Upload the dataset.

param key: session key to check validity.
type key: str
param train_file: training dataset file in FastAPI type.
type train_file: UploadFile
param test_file: validation dataset file in FastAPI type.
type test_file: UploadFile

return server status dict.

raises HTTPException:
If an error occured while loading the dataset or while
attempting to upload datasets in non-setup states.

MethodURL
POST/upload_dataset/{key}

Parameters

NameInDescriptionRequired
keypathRequired
Request Body
FieldTypeDescriptionRequired
train_filestringRequired
test_filestringRequired
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray

Model Ready

Check if the model is ready.

param key: session key to check validity.
type key: str

return server status dict.

MethodURL
GET/model_ready/{key}

Parameters

NameInDescriptionRequired
keypathRequired
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray

Download Model

Download the model.

param key: session key to check validity.
type key: str

return FileResponse, model in FastAPI response type.

raises HTTPException: If mode not trained yet.

MethodURL
GET/download_model/{key}

Parameters

NameInDescriptionRequired
keypathRequired
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray

Download Results

Download the test results.

param key: session key to check validity.
type key: str

return FileResponse, training results in FastAPI response type.

raises HTTPException: If mode not trained yet.

MethodURL
GET/download_results/{key}

Parameters

NameInDescriptionRequired
keypathRequired
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray

Healthcheck

Return a healthcheck status for the API.

return server status dict with healthcheck info.

MethodURL
GET/healthcheck

Parameters

NameInDescriptionRequired
Response (200)
FieldTypeDescription

Import Model

Start the model import process.

MethodURL
POST/import_model/{key}

Parameters

NameInDescriptionRequired
keypathRequired
model_typequeryRequired
model_namequeryRequired
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray

Import Status

Get the import status.

MethodURL
GET/import_status

Parameters

NameInDescriptionRequired
Response (200)
FieldTypeDescription

Get Imported Model

Get the imported model.

param key: session key to check validity.
type key: str

return server status dict.

raises HTTPException: If mode not trained yet.

MethodURL
GET/get_imported_model/{key}

Parameters

NameInDescriptionRequired
keypathRequired
on_diskqueryOptional
tokenizerqueryOptional
Response (200)
FieldTypeDescription
Response (422)
FieldTypeDescription
detailarray