Skip to content

Commit 3810a8f

Browse files
committed
Tabulate view for models info and remove commented out code
1 parent 5d47d3b commit 3810a8f

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

src/together/commands/finetune.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,3 @@ def _run_checkpoint(args: argparse.Namespace) -> None:
342342
checkpoints = Finetune.get_checkpoints(args.fine_tune_id)
343343
print(json.dumps(checkpoints, indent=4))
344344
print(f"\n{len(checkpoints)} checkpoints found")
345-
346-
347-
# def _run_delete_model(args: argparse.Namespace) -> None:
348-
# finetune = Finetune(args.endpoint)
349-
# response = finetune.delete_finetune_model(args.model)
350-
# print(json.dumps(response))

src/together/commands/models.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ def _run_list(args: argparse.Namespace) -> None:
147147

148148

149149
def _run_info(args: argparse.Namespace) -> None:
150-
if not args.raw:
150+
model_info = together.Models.info(args.model)
151+
152+
if args.raw:
153+
print(json.dumps(model_info, indent=4))
154+
else:
151155
hidden_keys = [
152156
"_id",
153157
"modelInstanceConfig",
@@ -159,13 +163,16 @@ def _run_info(args: argparse.Namespace) -> None:
159163
"pricing_tier",
160164
"hardware_label",
161165
"depth",
166+
"descriptionLink",
162167
]
163-
else:
164-
hidden_keys = []
165168

166-
model_info = together.Models.info(args.model, hidden_keys=hidden_keys)
167-
168-
print(json.dumps(model_info, indent=4))
169+
table_data = [
170+
{"Key": key, "Value": value}
171+
for key, value in model_info.items()
172+
if key not in hidden_keys
173+
]
174+
table = tabulate(table_data, tablefmt="grid")
175+
print(table)
169176

170177

171178
def _run_instances(args: argparse.Namespace) -> None:

src/together/files.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ def upload(
133133
logger.critical(f"Response error raised: {e}")
134134
raise together.ResponseError(e)
135135

136-
# output_dict["filename"] = os.path.basename(file)
137-
# output_dict["id"] = str(file_id)
138-
# output_dict["object"] = "file"
139-
140136
return {
141137
"filename": os.path.basename(file),
142138
"id": str(file_id),

0 commit comments

Comments
 (0)