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

Method load_groundtruths

src/dataset.py:551–561  ·  view source on GitHub ↗
(self, file_path = None)

Source from the content-addressed store, hash-verified

549 raise ValueError("Cannot find the file path for test cases.")
550
551 def load_groundtruths(self, file_path = None):
552 if file_path != None:
553 data = json.load(open(file_path, "r"))
554 self.prompt2groundtruth = data["prompt2groundtruth"]
555 self.prompt2io = data["prompt2io"]
556 elif self.data_path != None:
557 data = json.load(open(os.path.join(self.data_path, "solutions.json"), "r"))
558 self.prompt2groundtruth = data["prompt2groundtruth"]
559 self.prompt2io = data["prompt2io"]
560 else:
561 raise ValueError("Cannot find the file path for test cases.")
562
563 def remove_solutions_with_similar_time_costs(self, threshold = 0.1):
564 self.load_groundtruths()

Callers 5

print_infoMethod · 0.95
get_best_groundtruthMethod · 0.95
__init__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected