You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/deployments/batch-api/endpoints.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,14 +62,14 @@ RESPONSE:
62
62
63
63
### S3 file paths
64
64
65
-
If your input data is a list of files such as images/videos in an s3 directory, you can define `file_path_lister` in your submission request payload. You can use `file_path_lister.s3_paths` to specify a list of files or prefixes, and `file_path_lister.includes` and/or `file_path_lister.excludes` to remove unwanted files. The s3 file paths will be aggregated into batches of size `file_path_lister.batch_size`. To learn more about fine-grained S3 file filtering see [filtering files](#filtering-files).
65
+
If your input data is a list of files such as images/videos in an S3 directory, you can define `file_path_lister` in your submission request payload. You can use `file_path_lister.s3_paths` to specify a list of files or prefixes, and `file_path_lister.includes` and/or `file_path_lister.excludes` to remove unwanted files. The S3 file paths will be aggregated into batches of size `file_path_lister.batch_size`. To learn more about fine-grained S3 file filtering see [filtering files](#filtering-files).
66
66
67
67
__The total size of a batch must be less than 256 KiB.__
68
68
69
69
This submission pattern can be useful in the following scenarios:
70
70
71
-
* you have a list of images/videos in an s3 directory
72
-
* each s3 file represents a single sample or a small number of samples
71
+
* you have a list of images/videos in an S3 directory
72
+
* each S3 file represents a single sample or a small number of samples
73
73
74
74
If a single S3 file contains a lot of samples/rows, try the next submission strategy.
75
75
@@ -78,10 +78,10 @@ POST <batch_api_endpoint>/:
78
78
{
79
79
"workers": <int>, # the number of workers to allocate for this job (required)
80
80
"file_path_lister": {
81
-
"s3_paths": [<string>], # can be s3 prefixes or complete s3 paths (required)
81
+
"s3_paths": [<string>], # can be S3 prefixes or complete S3 paths (required)
"batch_size": <int>, # the number of s3 file paths per batch (the predict() function is called once per batch) (required)
84
+
"batch_size": <int>, # the number of S3 file paths per batch (the predict() function is called once per batch) (required)
85
85
}
86
86
"config": { # custom fields for this specific job (will override values in `config` specified in your api configuration) (optional)
87
87
"string": <any>
@@ -102,22 +102,22 @@ RESPONSE:
102
102
103
103
### Newline delimited JSON files in S3
104
104
105
-
If your input dataset is a newline delimited json file in an s3 directory (or a list of them), you can define `delimited_files` in your request payload to break up the contents of the file into batches of size `delimited_files.batch_size`.
105
+
If your input dataset is a newline delimited json file in an S3 directory (or a list of them), you can define `delimited_files` in your request payload to break up the contents of the file into batches of size `delimited_files.batch_size`.
106
106
107
-
Upon receiving `delimited_files`, your Batch API will iterate through the `delimited_files.s3_paths` to generate the set of s3 files to process. You can use `delimited_files.includes` and `delimited_files.excludes` to filter out unwanted files. Each S3 file will be parsed as a newline delimited JSON file. Each line in the file should be a JSON object, which will be treated as a single sample. The S3 file will be broken down into batches of size `delimited_files.batch_size` and submitted to your workers. To learn more about fine-grained S3 file filtering see [filtering files](#filtering-files).
107
+
Upon receiving `delimited_files`, your Batch API will iterate through the `delimited_files.s3_paths` to generate the set of S3 files to process. You can use `delimited_files.includes` and `delimited_files.excludes` to filter out unwanted files. Each S3 file will be parsed as a newline delimited JSON file. Each line in the file should be a JSON object, which will be treated as a single sample. The S3 file will be broken down into batches of size `delimited_files.batch_size` and submitted to your workers. To learn more about fine-grained S3 file filtering see [filtering files](#filtering-files).
108
108
109
109
__The total size of a batch must be less than 256 KiB.__
110
110
111
111
This submission pattern is useful in the following scenarios:
112
112
113
-
* one or more s3 files contains a large number of samples and must be broken down into batches
113
+
* one or more S3 files contains a large number of samples and must be broken down into batches
114
114
115
115
```yaml
116
116
POST <batch_api_endpoint>/:
117
117
{
118
118
"workers": <int>, # the number of workers to allocate for this job (required)
119
119
"delimited_files": {
120
-
"s3_paths": [<string>], # can be s3 prefixes or complete s3 paths (required)
120
+
"s3_paths": [<string>], # can be S3 prefixes or complete S3 paths (required)
"batch_size": <int>, # the number of json objects per batch (the predict() function is called once per batch) (required)
@@ -201,7 +201,7 @@ RESPONSE:
201
201
202
202
When submitting a job using `delimited_files` or `file_path_lister`, you can use `s3_paths` in conjunction with `includes` and `excludes` to precisely filter files.
203
203
204
-
The Batch API will iterate through each s3 path in `s3_paths`. If the s3 path is a prefix, it iterates through each file in that prefix. For each file, if `includes` is non-empty, it will discard the s3 path if the s3 file doesn't match any of the glob patterns provided in `includes`. After passing the `includes` filter (if specified), if the `excludes` is non-empty, it will discard the s3 path if the s3 files matches any of the glob patterns provided in `excludes`.
204
+
The Batch API will iterate through each S3 path in `s3_paths`. If the S3 path is a prefix, it iterates through each file in that prefix. For each file, if `includes` is non-empty, it will discard the S3 path if the S3 file doesn't match any of the glob patterns provided in `includes`. After passing the `includes` filter (if specified), if the `excludes` is non-empty, it will discard the S3 path if the S3 files matches any of the glob patterns provided in `excludes`.
205
205
206
206
If you aren't sure which files will be processed in your request, specify the `dryRun=true` query parameter in the job submission request to see the target list.
Copy file name to clipboardExpand all lines: docs/deployments/batch-api/predictors.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ For proper separation of concerns, it is recommended to use the constructor's `c
81
81
### Examples
82
82
83
83
<!-- CORTEX_VERSION_MINOR -->
84
-
You can find an example of a BatchAPI using a PythonPredictor in [examples/batch/image-classifier](https://github.com/cortexlabs/cortex/tree/master/examples/batch/image-classifier)
84
+
You can find an example of a BatchAPI using a PythonPredictor in [examples/batch/image-classifier](https://github.com/cortexlabs/cortex/tree/master/examples/batch/image-classifier).
85
85
86
86
### Pre-installed packages
87
87
@@ -198,7 +198,7 @@ For proper separation of concerns, it is recommended to use the constructor's `c
198
198
### Examples
199
199
200
200
<!-- CORTEX_VERSION_MINOR -->
201
-
You can find an example of a BatchAPI using a TensorFlowPredictor in [examples/batch/tensorflow](https://github.com/cortexlabs/cortex/tree/master/examples/batch/tensorflow)
201
+
You can find an example of a BatchAPI using a TensorFlowPredictor in [examples/batch/tensorflow](https://github.com/cortexlabs/cortex/tree/master/examples/batch/tensorflow).
202
202
203
203
### Pre-installed packages
204
204
@@ -267,7 +267,7 @@ For proper separation of concerns, it is recommended to use the constructor's `c
267
267
### Examples
268
268
269
269
<!-- CORTEX_VERSION_MINOR -->
270
-
You can find an example of a BatchAPI using an ONNXPredictor in [examples/batch/onnx](https://github.com/cortexlabs/cortex/tree/master/examples/batch/onnx)
270
+
You can find an example of a BatchAPI using an ONNXPredictor in [examples/batch/onnx](https://github.com/cortexlabs/cortex/tree/master/examples/batch/onnx).
Copy file name to clipboardExpand all lines: examples/batch/image-classifier/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -415,7 +415,7 @@ spinning up workers...
415
415
416
416
The status of your job, which you can get from `cortex get <BATCH_API_NAME> <JOB_ID>`, should change from `running` to `succeeded` once the job has completed. If it changes to a different status, you may be able to find the stacktrace using `cortex logs <BATCH_API_NAME> <JOB_ID>`. If your job has completed successfully, you can view the results of the image classification in the S3 directory you specified in the job submission.
417
417
418
-
Using AWS CLI:
418
+
Using the AWS CLI:
419
419
420
420
```bash
421
421
$ aws s3 ls $CORTEX_DEST_S3_DIR/<JOB_ID>/
@@ -524,7 +524,7 @@ spinning up workers...
524
524
525
525
The status of your job, which you can get from `cortex get <BATCH_API_NAME> <JOB_ID>`, should change from `running` to `succeeded` once the job has completed. If it changes to a different status, you may be able to find the stacktrace using `cortex logs <BATCH_API_NAME> <JOB_ID>`. If your job has completed successfully, you can view the results of the image classification in the S3 directory you specified in the job submission.
0 commit comments