@@ -223,14 +223,14 @@ async def lang_autocomplete(
223223 bot = interaction .client
224224
225225 with bot .leaderboard_db as db :
226- leaderboard_item = db .get_leaderboard (lb ) # type: LeaderboardItem
226+ templates = db .get_leaderboard_templates (lb )
227227
228- candidates = leaderboard_item [ "task" ]. templates
228+ candidates = list ( templates . keys ())
229229 return [discord .app_commands .Choice (name = c , value = c ) for c in candidates ]
230230
231231
232232def add_header_to_template (lang : str , code : str , lb : LeaderboardItem ):
233- comment_char = {"CUDA" : "//" , "Python" : "#" , "Triton" : "#" , "HIP" : "#" }[lang ]
233+ comment_char = {"CUDA" : "//" , "Python" : "#" , "Triton" : "#" , "HIP" : "#" , "CuteDSL" : "#" }[lang ]
234234
235235 description_comment = [f"{ comment_char } > { line } " for line in lb ["description" ].splitlines ()]
236236 header = f"""
@@ -539,7 +539,7 @@ async def get_task_template(
539539 return
540540
541541 template = add_header_to_template (lang , templates [lang ], leaderboard_item )
542- ext = {"CUDA" : "cu" , "Python" : "py" , "Triton" : "py" , "HIP" : "py" }
542+ ext = {"CUDA" : "cu" , "Python" : "py" , "Triton" : "py" , "HIP" : "py" , "CuteDSL" : "py" }
543543 file_name = f"{ leaderboard_name } .{ ext [lang ]} "
544544 file = discord .File (fp = StringIO (template ), filename = file_name )
545545 message = f"**Starter code for leaderboard `{ leaderboard_name } `**\n "
0 commit comments