Update app.py
Browse files
app.py
CHANGED
|
@@ -61,7 +61,8 @@ async def music_create(ctx, prompt, seed):
|
|
| 61 |
"""Runs music_create_job in executor"""
|
| 62 |
try:
|
| 63 |
message = await ctx.send(f"**{prompt}** - {ctx.author.mention} Generating...")
|
| 64 |
-
|
|
|
|
| 65 |
loop = asyncio.get_running_loop()
|
| 66 |
client = await loop.run_in_executor(None, get_client, None)
|
| 67 |
job = client.submit(prompt, seed, api_name="/predict")
|
|
@@ -79,11 +80,12 @@ async def music_create(ctx, prompt, seed):
|
|
| 79 |
|
| 80 |
with open(video, "rb") as file:
|
| 81 |
discord_video_file = discord.File(file, filename=video_filename)
|
| 82 |
-
await
|
| 83 |
|
| 84 |
with open(audio, "rb") as file:
|
| 85 |
discord_audio_file = discord.File(file, filename=audio_filename)
|
| 86 |
-
await
|
|
|
|
| 87 |
|
| 88 |
except QueueError:
|
| 89 |
await ctx.send("The gradio space powering this bot is really busy! Please try again later!")
|
|
|
|
| 61 |
"""Runs music_create_job in executor"""
|
| 62 |
try:
|
| 63 |
message = await ctx.send(f"**{prompt}** - {ctx.author.mention} Generating...")
|
| 64 |
+
thread = await message.create_thread(name=prompt[:100])
|
| 65 |
+
|
| 66 |
loop = asyncio.get_running_loop()
|
| 67 |
client = await loop.run_in_executor(None, get_client, None)
|
| 68 |
job = client.submit(prompt, seed, api_name="/predict")
|
|
|
|
| 80 |
|
| 81 |
with open(video, "rb") as file:
|
| 82 |
discord_video_file = discord.File(file, filename=video_filename)
|
| 83 |
+
await thread.send(file=discord_video_file)
|
| 84 |
|
| 85 |
with open(audio, "rb") as file:
|
| 86 |
discord_audio_file = discord.File(file, filename=audio_filename)
|
| 87 |
+
await thread.send(file=discord_audio_file)
|
| 88 |
+
#await message.delete()
|
| 89 |
|
| 90 |
except QueueError:
|
| 91 |
await ctx.send("The gradio space powering this bot is really busy! Please try again later!")
|