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

Method download_file

src/model.py:59–69  ·  view source on GitHub ↗
(self, batch_id)

Source from the content-addressed store, hash-verified

57 return response
58
59 def download_file(self, batch_id):
60 response = self.client.batches.retrieve(batch_id)
61 if response.status != "completed":
62 raise ValueError("The batch is not completed and its status is {}.".format(response.status))
63 output_file = response.output_file_id
64 content = self.client.files.content(output_file)
65 contents = content.content.splitlines()
66 outputs = []
67 for line in contents:
68 outputs.append(json.loads(line))
69 return outputs
70
71 def collect_errors(self, batch_id):
72 response = self.client.batches.retrieve(batch_id)

Callers 1

download_fileFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected