Skip to content
Merged
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
5 changes: 5 additions & 0 deletions src/together/lib/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,11 @@ async def run_command() -> None:
help_epilogue=BETA_ENDPOINTS_LS_HELP_EXAMPLES,
sort_key=2,
)
beta_endpoints_app.command(
(f"{_CLI}.beta.endpoints.list:list"),
name="list",
show=False,
)
beta_endpoints_app.command(
(f"{_CLI}.beta.endpoints.retrieve:retrieve"),
name="get",
Expand Down
4 changes: 2 additions & 2 deletions src/together/lib/cli/api/fine_tuning/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
int_or_max_converter,
)
from together.lib.cli.utils.config import CLIConfigParameter
from together.lib.cli.utils._prompt import confirm as prompt_confirm
from together.lib.cli.utils._console import console
from together.lib.cli.components.loader import show_loading_status
from together.lib.resources.fine_tuning import validate_early_stopping
Expand Down Expand Up @@ -392,8 +393,7 @@ async def create(

if not confirm:
console.print(get_confirmation_message(price_line=price_line, warning=warning))
resp = input("Do you want to proceed? [Y/n]").strip().lower()
if resp and resp != "y" and resp != "yes":
if not config.non_interactive and not await prompt_confirm("Do you want to proceed?"):
return

console.print(f"Submitting a fine-tuning job with the following parameters:")
Expand Down
13 changes: 11 additions & 2 deletions tests/cli/test_beta_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,17 @@ def test_deploy_onto_existing_endpoint(self, respx_mock: MockRouter, cli_runner:


class TestBetaEndpointsList:
def test_list_alias_is_hidden_from_help(self, cli_runner: CliRunner) -> None:
result = cli_runner.invoke(["beta", "endpoints", "--help"])

output = " ".join(result.output.split())
assert result.exit_code == 0
assert "ls: List project, organization, or public endpoints" in output
assert "list: List project, organization, or public endpoints" not in output

@pytest.mark.parametrize("command", ["list", "ls"])
@pytest.mark.respx(base_url=base_url)
def test_list_sends_cursor_pagination(self, respx_mock: MockRouter, cli_runner: CliRunner) -> None:
def test_list_sends_cursor_pagination(self, command: str, respx_mock: MockRouter, cli_runner: CliRunner) -> None:
route = respx_mock.get("/projects/proj/endpoints").mock(
return_value=httpx.Response(
200,
Expand All @@ -245,7 +254,7 @@ def test_list_sends_cursor_pagination(self, respx_mock: MockRouter, cli_runner:
)

result = cli_runner.invoke(
["beta", "endpoints", "ls", "--project", "proj", "--limit", "10", "--after", "tok", "--json"]
["beta", "endpoints", command, "--project", "proj", "--limit", "10", "--after", "tok", "--json"]
)

assert result.exit_code == 0, result.output
Expand Down
4 changes: 2 additions & 2 deletions tests/cli/test_fine_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ def test_create_handles_unavailable_price_estimation(self, respx_mock: MockRoute
"file-train",
"--model",
"meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo",
"--non-interactive",
],
input="y\n",
)

output = " ".join(result.output.split())
assert result.exit_code == 0
assert "not available for multimodal datasets" in output
assert "Do you want to proceed?" in result.output
assert "Do you want to proceed?" not in result.output
assert "ft-created" in result.output
assert estimate.calls
assert create.calls
Expand Down
Loading