Skip to content

Commit

Permalink
Fix: application timeout in fast-track if only 1 gpu available (#151)
Browse files Browse the repository at this point in the history
* Fix: application timeout in fast-track if only 1 gpu

* Fix: reply to message so bot 'stops thinking'
  • Loading branch information
S1ro1 authored Jan 23, 2025
1 parent b9d5a2a commit 1854e3f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/discord-cluster-manager/cogs/leaderboard_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ async def select_gpu_view(
"""
UI displayed to user to select GPUs that they want to use.
"""
if not interaction.response.is_done():
await interaction.response.defer(ephemeral=True)

view = GPUSelectionView(gpus)

await send_discord_message(
Expand Down Expand Up @@ -200,7 +197,14 @@ async def on_submit_hook(

# if there is more than one candidate GPU, display UI to let user select,
# otherwise just run on that GPU
if not interaction.response.is_done():
await interaction.response.defer(ephemeral=True)
if len(gpus) == 1:
await send_discord_message(
interaction,
f"Running on GPU: **{gpus[0]}**",
ephemeral=True,
)
selected_gpus = gpus
else:
view = await self.select_gpu_view(interaction, leaderboard_name, gpus)
Expand Down

0 comments on commit 1854e3f

Please sign in to comment.