BatchJob
Batch job.
Source code in hume/_batch/batch_job.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
__init__(client, job_id)
Construct a BatchJob.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client |
HumeBatchClient
|
HumeBatchClient instance. |
required |
job_id |
str
|
Job ID. |
required |
__repr__()
Get the string representation of the BatchJob
.
Returns:
Type | Description |
---|---|
str
|
The the string representation of the |
await_complete(timeout=300, raise_on_failed=False)
Block until the job has reached a terminal status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timeout |
int
|
Maximum time in seconds to await. If the timeout is reached
before the job reaches a terminal state the job will continue to be processed,
but a |
300
|
raise_on_failed |
bool
|
If set to True and job fails an exception will be raised. |
False
|
Raises:
Type | Description |
---|---|
ValueError
|
If the timeout is not valid. |
HumeClientException
|
If the |
Returns:
Name | Type | Description |
---|---|---|
BatchJobDetails |
BatchJobDetails
|
Details for the |
Source code in hume/_batch/batch_job.py
download_artifacts(filepath)
Download BatchJob
artifacts zip file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filepath |
Optional[Union[str, Path]]
|
Filepath where artifacts will be downloaded. |
required |
Source code in hume/_batch/batch_job.py
download_predictions(filepath)
Download BatchJob
predictions file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filepath |
Union[str, Path]
|
Filepath where predictions will be downloaded. |
required |
Source code in hume/_batch/batch_job.py
get_details()
Get details for the BatchJob.
Note that the details for a job may be fetched before the job has completed.
You may want to use job.await_complete()
which will wait for the job to
reach a terminal state before returning.
Returns:
Name | Type | Description |
---|---|---|
BatchJobDetails |
BatchJobDetails
|
Details for the |
Source code in hume/_batch/batch_job.py
get_predictions()
Get BatchJob
predictions.
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
Predictions for the |
get_status()
Get the status of the job.
Returns:
Name | Type | Description |
---|---|---|
BatchJobStatus |
BatchJobStatus
|
The status of the |