MCPcopy Create free account
hub / github.com/InternScience/InternAgent / run

Method run

tasks/AutoTTS/code/main.py:163–188  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

161 print(f"Results saved to {final_info_path}")
162
163 async def run(self) -> float:
164 # Run experiment and return accuracy
165 print(f"Running {self.mode} experiment on {self.dataset} dataset from index {self.start} to {self.end}")
166
167 # Load test set
168 testset = load_data(self.dataset, "test")[self.start:self.end]
169 results = await self.gather_results(testset)
170
171 # Build results
172 json_obj = [self.construct_entry(result, data) for result, data in zip(results, testset)]
173 accuracy = sum(entry["score"] for entry in json_obj) / len(json_obj)
174
175 # Save detailed results
176 detailed_log_file = os.path.join(os.path.dirname(os.path.dirname(__file__)), "detailed_results.json")
177 save_json(detailed_log_file, json_obj)
178 print(f"Detailed results saved to {detailed_log_file}")
179
180 # Save final_info.json
181 self.save_final_info(accuracy)
182
183 # Print result summary
184 print(f"Unsolved: {round((1-accuracy) * len(json_obj))}")
185 print(f"Accuracy: {accuracy:.4f}")
186 print(f"Time taken: {duration_formatter(time.time() - self.timestamp)}")
187
188 return accuracy
189
190
191async def optimize_dataset(dataset: str, model: str, start: int = 0, end: int = -1):

Callers 7

mainFunction · 0.95
mainFunction · 0.45
mainFunction · 0.45
mcp_demo.pyFile · 0.45
demo.pyFile · 0.45
main.pyFile · 0.45

Calls 6

gather_resultsMethod · 0.95
construct_entryMethod · 0.95
save_final_infoMethod · 0.95
load_dataFunction · 0.90
save_jsonFunction · 0.90
duration_formatterFunction · 0.90

Tested by

no test coverage detected