@@ -93,6 +93,7 @@ async def submit_leaderboard( # noqa: C901
9393 name = name ,
9494 task = task ,
9595 mode = mode ,
96+ submission_id = submission_id ,
9697 )
9798
9899 if result .success :
@@ -183,6 +184,7 @@ async def _handle_submission(
183184 name : str ,
184185 task : Optional [LeaderboardTask ],
185186 mode : SubmissionMode ,
187+ submission_id : int = - 1 ,
186188 ) -> Optional [FullResult ]:
187189 """
188190 Generic function to handle code submissions.
@@ -192,6 +194,7 @@ async def _handle_submission(
192194 code: Submitted code
193195 name: File name of the submission; used to infer code's language
194196 task: Task specification, of provided
197+ submission_id: ID of the submission, only used for display purposes
195198
196199 Returns:
197200 if successful, returns the result of the run.
@@ -212,15 +215,17 @@ async def _handle_submission(
212215 else :
213216 await reporter .update_title (reporter .title + " ✅ success" )
214217
215- await reporter .push (
216- make_short_report (
217- result .runs , full = mode in [SubmissionMode .PRIVATE , SubmissionMode .LEADERBOARD ]
218- )
218+ short_report = make_short_report (
219+ result .runs , full = mode in [SubmissionMode .PRIVATE , SubmissionMode .LEADERBOARD ]
219220 )
221+ await reporter .push (short_report )
220222 if mode != SubmissionMode .PRIVATE :
221223 try :
224+ # does the last message of the short report start with ✅ or ❌?
225+ verdict = short_report [- 1 ][0 ]
226+ id_str = f"{ verdict } " if submission_id == - 1 else f"{ verdict } #{ submission_id } "
222227 await reporter .generate_report (
223- f"{ name } on { gpu_type .name } ({ launcher .name } )" , result .runs
228+ f"{ id_str } { name } on { gpu_type .name } ({ launcher .name } )" , result .runs
224229 )
225230 except Exception as E :
226231 logger .error ("Error generating report. Result: %s" , result , exc_info = E )
0 commit comments