Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/art/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@ async def _experimental_pull_from_s3(
verbose: bool = False,
delete: bool = False,
only_step: int | Literal["latest"] | None = None,
exclude: list[Literal["checkpoints", "logs", "trajectories"]] | None = None,
) -> None:
"""Download the model directory from S3 into file system where the LocalBackend is running. Right now this can be used to pull trajectory logs for processing or model checkpoints.

Args:
only_step: If specified, only pull this specific step. Can be an int for a specific step,
or "latest" to pull only the latest checkpoint. If None, pulls all steps.
exclude: List of directories to exclude from sync. Valid options: "checkpoints", "logs", "trajectories".
"""
response = await self._client.post(
"/_experimental_pull_from_s3",
Expand All @@ -156,6 +158,7 @@ async def _experimental_pull_from_s3(
"verbose": verbose,
"delete": delete,
"only_step": only_step,
"exclude": exclude,
},
timeout=600,
)
Expand Down
6 changes: 5 additions & 1 deletion src/art/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
import socket
from typing import Any, AsyncIterator
from typing import Any, AsyncIterator, Literal

import pydantic
import typer
Expand Down Expand Up @@ -101,13 +101,17 @@ async def _experimental_pull_from_s3(
prefix: str | None = Body(None),
verbose: bool = Body(False),
delete: bool = Body(False),
only_step: int | Literal["latest"] | None = Body(None),
exclude: list[Literal["checkpoints", "logs", "trajectories"]] | None = Body(None),
):
await backend._experimental_pull_from_s3(
model=model,
s3_bucket=s3_bucket,
prefix=prefix,
verbose=verbose,
delete=delete,
only_step=only_step,
exclude=exclude,
)

@app.post("/_experimental_push_to_s3")
Expand Down