GuidesRecipesAPI ReferenceChangelogDiscussions
Log In

EdgeClient.jobs.submit_embedded

Submit a job with the Edge client using bytes or byte arrays as inputs

EdgeClient.jobs.submit_embedded(identifier, version, sources, explain=False)

Submit a job with the Edge client based on byte array inputs, the sources dictionary is a double dict structure as follows:

{
  '<<<<input-item-key>>>>': {
    '<<<<data-input-item-key>>>>: b'This is binary content'
  }
}

Where:

<<<<input-item-key>>>>: are user defined keys to identify the input items.
<<<<data-input-item-key>>>>: are model defined keys (usually file names).

Parameters

ParameterTypeDescriptionExample
identifierstr
Model
Model identifier provided by Modzy or a model object previusly loaded.'ed542963de'
versionstrThe model’s version number. It follows the semantic versioning format.'1.0.1'
sourcesdictA mapping of source names to byte arrays. Each source should be a mapping of model input key to a byte array.'{'my-input': {'input.txt': bytearray([1,2,3,4])}}'
explainboolIf the model supports explainability, flag this job to return an explanation of the predictionsTrue

Returns

A Job object with the status from the server

{
  "job_identifier": "string",
  "status",
  "account_identifier": "string",        
  "explain": "boolean",        
  "created_at": "date-time",
  "updated_at": "date-time",
  "submitted_at": "date-time",
  "submitted_by": "string",        
  "pending": "integer",
  "completed": "integer",    
  "failed": "integer",
  "total": "integer",    
  "model": {
    "identifier": "string",
    "version": "string",
    "name": "string"
  },
  "job_inputs": ["string"],
  "user": {
    "identifier": "string",
    "external_identifier": "string",
    "email": "string",
    "firstName": "string",      
    "lastName": "string",
    "status": "string",
    "title": "string"
    "access_keys": [
    	{
    		"prefix": "string",
        "is_default": "boolean"
  		}
    ]                        
  }
}

Examples

from modzy import EdgeClient
client = EdgeClient("localhost", 55000)
job = client.jobs.submit_embedded('model-identifier', '1.2.3',
{
    'source-name-1': {
        'model-input-name-1': b'some bytes',
        'model-input-name-2': bytearray([1,2,3,4]),
    },
    'source-name-2': {
        'model-input-name-1': b'some bytes',
        'model-input-name-2': bytearray([1,2,3,4]),
    }
})