Skip to content

Commit bf5b62f

Browse files
blainekastenstainless-app[bot]
authored andcommitted
format code
1 parent bf5267f commit bf5b62f

File tree

4 files changed

+10
-25
lines changed

4 files changed

+10
-25
lines changed

src/together/lib/cli/api/beta/jig/jig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ def handle_create() -> dict[str, Any]:
526526
# "failed to delete deployment from kubernetes: %w"
527527
# errors for toKubernetesEnvironmentVariables, toKubernetesVolumeMounts, getCustomScalers, ReconcileWithKubernetes
528528
error_body: Any = getattr(e, "body", None)
529-
error_message = error_body.get("error", "") if isinstance(error_body, dict) else "" # pyright: ignore
529+
error_message = error_body.get("error", "") if isinstance(error_body, dict) else "" # pyright: ignore
530530
if "already exists" in error_message or "must be unique" in error_message:
531531
raise RuntimeError(f"Deployment name must be unique. Tip: {config._unique_name_tip}") from None
532532
# TODO: helpful tips for more error cases

src/together/lib/cli/api/endpoints/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def endpoints(ctx: click.Context) -> None:
2323

2424
def print_endpoint(endpoint: DedicatedEndpoint | DedicatedEndpointListItem, show_autoscaling: bool = True) -> None:
2525
"""Print endpoint details in a Docker-like format or JSON.
26-
26+
2727
Args:
2828
endpoint: The endpoint to print
2929
show_autoscaling: Whether to show min/max replicas (only for user's own endpoints)

src/together/lib/cli/api/endpoints/_utils.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,9 @@ def wrapper(*args: Any, **kwargs: Any) -> Any:
3434
endpoint_id = kwargs.get("endpoint_id", "")
3535
endpoint_display = f"'{endpoint_id}'" if endpoint_id else ""
3636
click.echo(prefix_styled + click.style("Failed", fg="red"))
37+
click.echo(prefix_styled + click.style(f"Endpoint {endpoint_display} not found.", fg="red"))
3738
click.echo(
38-
prefix_styled
39-
+ click.style(f"Endpoint {endpoint_display} not found.", fg="red")
40-
)
41-
click.echo(
42-
prefix_styled
43-
+ "The endpoint may have been deleted or the ID may be incorrect.",
39+
prefix_styled + "The endpoint may have been deleted or the ID may be incorrect.",
4440
err=True,
4541
)
4642
click.echo(
@@ -51,10 +47,7 @@ def wrapper(*args: Any, **kwargs: Any) -> Any:
5147
if "permission" in error_lower or "forbidden" in error_lower or "unauthorized" in error_lower:
5248
click.echo(prefix_styled + click.style("Failed", fg="red"))
5349
click.echo(
54-
prefix_styled
55-
+ click.style(
56-
"You don't have permission to access this resource.", fg="red"
57-
)
50+
prefix_styled + click.style("You don't have permission to access this resource.", fg="red")
5851
)
5952
click.echo(
6053
prefix_styled + "This may belong to another user or organization.",
@@ -63,10 +56,7 @@ def wrapper(*args: Any, **kwargs: Any) -> Any:
6356
sys.exit(1)
6457
if "credentials" in error_lower or "authentication" in error_lower:
6558
click.echo(prefix_styled + click.style("Failed", fg="red"))
66-
click.echo(
67-
prefix_styled
68-
+ click.style("Invalid API key or authentication failed.", fg="red")
69-
)
59+
click.echo(prefix_styled + click.style("Invalid API key or authentication failed.", fg="red"))
7060
sys.exit(1)
7161
raise e
7262

src/together/lib/cli/api/endpoints/create.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ def create(
9797
# Validate min <= max replicas
9898
if min_replicas > max_replicas:
9999
click.echo(
100-
f"Error: --min-replicas ({min_replicas}) cannot be greater than "
101-
f"--max-replicas ({max_replicas})",
100+
f"Error: --min-replicas ({min_replicas}) cannot be greater than --max-replicas ({max_replicas})",
102101
err=True,
103102
)
104103
sys.exit(1)
@@ -108,9 +107,7 @@ def create(
108107
try:
109108
valid_zones = client.endpoints.list_avzones()
110109
if availability_zone not in valid_zones.avzones:
111-
click.echo(
112-
f"Error: Invalid availability zone '{availability_zone}'", err=True
113-
)
110+
click.echo(f"Error: Invalid availability zone '{availability_zone}'", err=True)
114111
if valid_zones.avzones:
115112
click.echo("Available zones:", err=True)
116113
for zone in sorted(valid_zones.avzones):
@@ -163,13 +160,11 @@ def create(
163160
or "not supported" in error_msg
164161
):
165162
click.echo(
166-
f"Error: Model '{model}' was not found or is not available for "
167-
"dedicated endpoints.",
163+
f"Error: Model '{model}' was not found or is not available for dedicated endpoints.",
168164
err=True,
169165
)
170166
click.echo(
171-
"Please check that the model name is correct and that it supports "
172-
"dedicated endpoint deployment.",
167+
"Please check that the model name is correct and that it supports dedicated endpoint deployment.",
173168
err=True,
174169
)
175170
click.echo(

0 commit comments

Comments
 (0)