modzyClient.getJobClient().submitJob
Submits a Job for processing
submitJob(String modelId, String modelVersionId, JobInput<?> jobInput, Boolean explain)
Submits a job based on the inputs provided. The structure is handled by the JobInput
type provided (see below).
Parameters
Parameter | Type | Description | Example |
---|---|---|---|
|
| Model identifier provided by Modzy. |
|
|
| The model’s version number. It follows the semantic versioning format. |
|
| A subclass of
|
| |
|
| If the model supports explainability, flag this job to return an explanation of the predictions |
|
Returns
com.modzy.sdk.model.Job
A Job
object with the job status obtained from the server.
Examples
Text Inputs
Submits a job with text as inputs
JobInput<String> jobInput = new JobInputText();
Map<String,String> mapSource = new HashMap<>();
mapSource.put("input.txt", "Modzy is great!");
jobInput.addSource("my-input", mapSource);
Job job = modzyClient.submitJob("ed542963de", "1.0.1", jobInput, false);
Embedded Inputs
Submits a job with bytes as inputs
JobInput<EmbeddedData> jobInput = new JobInputEmbedded();
Map<String,EmbeddedData> mapSource = new HashMap<>();
mapSource.put("input.txt", new EmbeddedData("text/plain", "Modzy is great!".getBytes(StandardCharsets.UTF_8)));
jobInput.addSource("my-input", mapSource);
Job job = modzyClient.submitJob("ed542963de", "1.0.1", jobInput, false);
File Inputs
JobInput<InputStream> jobInput = new JobInputStream();
Map<String,InputStream> mapSource = new HashMap<>();
mapSource.put("input.txt", new FileInputStream( "/usr/inputs/some_file.txt" ));
jobInput.addSource("my-input", mapSource);
Job job = modzyClient.submitJob("ed542963de", "1.0.1", jobInput, false);
AWS S3 Input
JobInput<S3FileRef> jobInput = new JobInputS3("accessKey", "secretAccessKey", "us-east-1");
Map<String,S3FileRef> mapSource = new HashMap<>();
mapSource.put("image", new S3FileRef("someBucket", "someKey"));
jobInput.addSource("my-input", mapSource);
Job job = modzyClient.submitJob("ed542963de", "1.0.1", jobInput, false);
JDBC
JobInput<String> jobInput = new JobInputJDBC("jdbc:postgresql://database-host:5432/mydatabase", "username", "password", "org.posgresql.Driver", "select description as \'input.txt\' from my-table");
Job job = modzyClient.submitJob("ed542963de", "1.0.1", jobInput, false);
Updated 9 months ago