-
Notifications
You must be signed in to change notification settings - Fork 0
fix: fix autoscaling config type #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dulaj-me
wants to merge
10
commits into
next
Choose a base branch
from
dulaj/autoscaling-configs
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
eae629e
fix(cli): Improve output when downloading an incomplete finetune job …
blainekasten a73f525
chore(cli): Improve output for `fine-tuning list` and `files list` co…
blainekasten bae0065
fix(cli): Improve error output message when model/checkpoint is not p…
blainekasten b9bb6e0
feat(cli): Add --json to `fine-tuning retrieve` (#272)
blainekasten 089d4b9
chore(cli): Improve output for file uploads and fine-tuning create (#…
blainekasten 174bf4d
chore(internal): add request options to SSE classes
stainless-app[bot] 5d5aa42
codegen metadata
stainless-app[bot] eb89afd
chore(internal): make `test_proxy_environment_variables` more resilient
stainless-app[bot] 0bf71ae
chore(internal): make `test_proxy_environment_variables` more resilie…
stainless-app[bot] f06454c
fix: fix autoscaling config type
dulaj-me File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| configured_endpoints: 74 | ||
| openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-da5b9df3bfe0d31a76c91444c9eba060ad607d7d5a4e7483c5cc3fe2cac0f25e.yml | ||
| openapi_spec_hash: 7efd2ae2111f3a9bf190485828a13252 | ||
| openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-41003d5ea35fdc4ec5c03cd7933dc5fee020d818abb1ea71f1d20d767cce06a0.yml | ||
| openapi_spec_hash: 651ade27191eb5ad232ec508418fe4cb | ||
| config_hash: b66198d27b4d5c152688ff6cccfdeab5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,47 @@ | ||
| from typing import Any, Dict, List | ||
| from textwrap import wrap | ||
| from datetime import datetime, timezone | ||
|
|
||
| import click | ||
| from tabulate import tabulate | ||
|
|
||
| from together import Together | ||
| from together.lib.utils import convert_bytes, convert_unix_timestamp | ||
| from together._utils._json import openapi_dumps | ||
| from together.lib.utils.tools import format_timestamp | ||
| from together.lib.cli.api._utils import handle_api_errors | ||
|
|
||
|
|
||
| @click.command() | ||
| @click.pass_context | ||
| @click.option("--json", is_flag=True, help="Print output in JSON format") | ||
| @handle_api_errors("Files") | ||
| def list(ctx: click.Context) -> None: | ||
| def list(ctx: click.Context, json: bool) -> None: | ||
| """List files""" | ||
| client: Together = ctx.obj | ||
|
|
||
| response = client.files.list() | ||
|
|
||
| response.data = response.data or [] | ||
|
|
||
| # Use a default datetime for None values to make sure the key function always returns a comparable value | ||
| # Sort newest to oldest | ||
| epoch_start = datetime.fromtimestamp(0, tz=timezone.utc) | ||
| response.data.sort(key=lambda x: x.created_at or epoch_start, reverse=True) | ||
|
|
||
| if json: | ||
| click.echo(openapi_dumps(response.data)) | ||
| return | ||
|
|
||
| display_list: List[Dict[str, Any]] = [] | ||
| for i in response.data or []: | ||
| for i in response.data: | ||
| display_list.append( | ||
| { | ||
| "File name": "\n".join(wrap(i.filename or "", width=30)), | ||
| "File ID": i.id, | ||
| "Size": convert_bytes(float(str(i.bytes))), # convert to string for mypy typing | ||
| "Created At": convert_unix_timestamp(i.created_at or 0), | ||
| "ID": click.style(i.id, fg="blue"), | ||
| "File name": click.style(i.filename or "", fg="blue"), | ||
| "Size": click.style(convert_bytes(float(str(i.bytes))), fg="blue"), # convert to string for mypy typing | ||
| "Created At": click.style(format_timestamp(convert_unix_timestamp(i.created_at or 0)), fg="blue"), | ||
| } | ||
| ) | ||
| table = tabulate(display_list, headers="keys", tablefmt="grid", showindex=True) | ||
| table = tabulate(display_list, headers="keys") | ||
|
|
||
| click.echo(table) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we do
autoscaling['target'] = float(autoscaling['target']before sending it in the request? so that existing configs work with the backend change?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still wondering if we can just greenfield this at this stage. Otherwise, very least we should show a deprecation warning for str floats imo.