BatchJobResult
Batch job result.
Source code in hume/_batch/batch_job_result.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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
|
__init__(*, configs, urls, status, predictions_url=None, artifacts_url=None, errors_url=None, error_message=None, job_start_time=None, job_end_time=None)
Construct a BatchJobResult.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
configs |
Dict[ModelType, ModelConfigBase]
|
Configurations for the |
required |
urls |
List[str]
|
URLs processed in the |
required |
status |
BatchJobStatus
|
Status of |
required |
predictions_url |
Optional[str]
|
URL to predictions file. |
None
|
artifacts_url |
Optional[str]
|
URL to artifacts zip archive. |
None
|
errors_url |
Optional[str]
|
URL to errors file. |
None
|
error_message |
Optional[str]
|
Error message for request. |
None
|
job_start_time |
Optional[int]
|
Time when job started. |
None
|
job_end_time |
Optional[int]
|
Time when job completed. |
None
|
Source code in hume/_batch/batch_job_result.py
download_artifacts(filepath=None)
Download BatchJob
artifacts zip archive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filepath |
Optional[Union[str, Path]]
|
Filepath where artifacts zip archive will be downloaded. |
None
|
Source code in hume/_batch/batch_job_result.py
download_errors(filepath=None)
Download BatchJob
errors file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filepath |
Optional[Union[str, Path]]
|
Filepath where errors will be downloaded. |
None
|
Source code in hume/_batch/batch_job_result.py
download_predictions(filepath=None)
Download BatchJob
predictions file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filepath |
Optional[Union[str, Path]]
|
Filepath where predictions will be downloaded. |
None
|
Source code in hume/_batch/batch_job_result.py
from_response(response)
classmethod
Construct a BatchJobResult
from a batch API job response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
response |
Any
|
Batch API job response. |
required |
Returns:
Name | Type | Description |
---|---|---|
BatchJobResult |
BatchJobResult
|
A |
Source code in hume/_batch/batch_job_result.py
get_end_time()
Get the time the job stopped running if the job is in a terminal state.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
Optional[datetime]: Datetime when the job started running. If the job is not in a terminal
state then |
Source code in hume/_batch/batch_job_result.py
get_error_message()
Get any available error messages on the job.
Returns:
Type | Description |
---|---|
Optional[str]
|
Optional[str]: A string with the error message if there was an error, otherwise |
get_run_time()
Get the total time in seconds it took for the job to run if the job is in a terminal state.
Returns:
Type | Description |
---|---|
Optional[int]
|
Optional[int]: Time in seconds it took for the job to run. If the job is not in a terminal
state then |
Source code in hume/_batch/batch_job_result.py
get_start_time()
Get the time the job started running.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
Optional[datetime]: Datetime when the job started running. If the job has not started
then |