|
24 | 24 | def save_grade_info(log_trace_path: Path):
|
25 | 25 | test_eval = get_test_eval()
|
26 | 26 |
|
27 |
| - is_mle = isinstance(test_eval, MLETestEval) |
28 | 27 | trace_storage = FileStorage(log_trace_path)
|
29 |
| - for msg in trace_storage.iter_msg(): |
30 |
| - if "competition" in msg.tag: |
31 |
| - competition = msg.content |
| 28 | + for msg in trace_storage.iter_msg(tag="competition"): |
| 29 | + competition = msg.content |
32 | 30 |
|
33 |
| - if "running" in msg.tag: |
34 |
| - if isinstance(msg.content, DSExperiment): |
35 |
| - # TODO: mle_score.txt is not a general name now. |
36 |
| - # Please use a more general name like test_score.txt |
37 |
| - try: |
38 |
| - mle_score_str = test_eval.eval(competition, msg.content.experiment_workspace) |
39 |
| - trace_storage.log( |
40 |
| - mle_score_str, tag=f"{msg.tag}.mle_score.pid", save_type="pkl", timestamp=msg.timestamp |
41 |
| - ) |
42 |
| - except Exception as e: |
43 |
| - print(f"Error in {log_trace_path}: {e}", traceback.format_exc()) |
| 31 | + for msg in trace_storage.iter_msg(tag="running"): |
| 32 | + if isinstance(msg.content, DSExperiment): |
| 33 | + # TODO: mle_score.txt is not a general name now. |
| 34 | + # Please use a more general name like test_score.txt |
| 35 | + try: |
| 36 | + mle_score_str = test_eval.eval(competition, msg.content.experiment_workspace) |
| 37 | + trace_storage.log( |
| 38 | + mle_score_str, tag=f"{msg.tag}.mle_score.pid", save_type="pkl", timestamp=msg.timestamp |
| 39 | + ) |
| 40 | + except Exception as e: |
| 41 | + print(f"Error in {log_trace_path}: {e}", traceback.format_exc()) |
44 | 42 |
|
45 | 43 |
|
46 | 44 | def save_all_grade_info(log_folder: str | Path) -> None:
|
|
0 commit comments