Volumes
Input Volumes
Input volumes are used to specify the data that will be made available to the job during its execution. These can include files, datasets, or other resources that the job needs to access. The following input volume types are supported:
- compute_horde_sdk.v1.InputVolume
alias of
InlineInputVolume
|HuggingfaceInputVolume
|HTTPInputVolume
- class compute_horde_sdk.v1.HuggingfaceInputVolume
Volume for downloading resources from Huggingface.
By default, it downloads the entire repository and copies its structure. To narrow it down, use the
allow_patterns
field. If a file is inside a subfolder, it will be placed under the same path in the volume.- repo_id: str
Huggingface repository ID, in the format “namespace/name”.
- repo_type: str | None
Set to “dataset” or “space” for a dataset or space, None or “model” for a model.
- revision: str | None
Git revision ID: branch name / tag / commit hash.
- allow_patterns: str | list[str] | None
If provided, only files matching at least one pattern are downloaded.
Output Volumes
Output volumes are used to specify where the outputs of the job will be stored. These can include files generated by the job. The following output volume types are supported:
- compute_horde_sdk.v1.OutputVolume
alias of
HTTPOutputVolume
- class compute_horde_sdk.v1.HTTPOutputVolume
Volume for uploading files to the Internet via HTTP.
Supports both HTTP PUT and POST uploads.
For PUT uploads, provide the full presigned URL using the url parameter.
For POST uploads, also include any required form fields using the form_fields dictionary.
Examples: PUT upload:
- HTTPOutputVolume(
http_method=”PUT”, url=”https://<your-presigned-url>”
)
- POST upload:
- HTTPOutputVolume(
http_method=”POST”, url=”https://<your-presigned-post-url>”, form_fields={
“key”: “example.txt”, “policy”: “<base64-policy>”, “signature”: “<signature>”, “AWSAccessKeyId”: “<access-key-id>”
}
)
- Note:
The SDK does not generate presigned URLs for you. Use tools like boto3, or your S3 provider’s SDK to generate the required url and optional form_fields.
- http_method: Literal['POST', 'PUT']
HTTP method to use, can be POST or PUT.
- url: str
The URL to upload the file to.