MCPcopy Create free account
hub / github.com/SalesforceAIResearch/perfcodegen / download_file

Function download_file

src/inference.py:1115–1132  ·  view source on GitHub ↗
(model, ids)

Source from the content-addressed store, hash-verified

1113 model.delete_file(i)
1114
1115def download_file(model, ids):
1116 model = RemoteModel(model)
1117 contents = []
1118 for i in ids:
1119 contents += model.download_file(i)
1120 data = {}
1121 for d in contents:
1122 data[d["custom_id"]] = d["response"]["body"]["choices"][0]["message"]
1123
1124 errors = []
1125 for i in ids:
1126 errors += model.collect_errors(i)
1127
1128 for e in errors:
1129 data[e["custom_id"]] = None
1130
1131 with open("prompt_chat_results/gpt-4/time/rd1_batch_outputs.json", "w", encoding = "utf-8") as f:
1132 f.write(json.dumps(data, sort_keys=True, indent=4, separators=(',', ': ')))
1133
1134
1135def batch_run(model, ids):

Callers

nothing calls this directly

Calls 3

download_fileMethod · 0.95
collect_errorsMethod · 0.95
RemoteModelClass · 0.90

Tested by

no test coverage detected