def get_total_threads():
Browse files
app.py
CHANGED
@@ -15,6 +15,10 @@ import asyncio
|
|
15 |
import shutil # for doing image movement magic
|
16 |
import concurrent.futures
|
17 |
# reboot
|
|
|
|
|
|
|
|
|
18 |
|
19 |
DFIF_TOKEN = os.getenv('HF_TOKEN')
|
20 |
DISCORD_TOKEN = os.environ.get("GRADIOTEST_TOKEN", None)
|
@@ -66,12 +70,25 @@ async def generation(ctx, attachment):
|
|
66 |
ctx.message.add_reaction('β
')
|
67 |
)
|
68 |
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
#--------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
def run_bot():
|
76 |
bot.run(DISCORD_TOKEN)
|
77 |
|
@@ -87,13 +104,7 @@ demo.launch()
|
|
87 |
|
88 |
|
89 |
'''
|
90 |
-
|
91 |
-
await asyncio.gather(
|
92 |
-
ctx.send(f'{ctx.author.mention} Here is the jojo version of it'),
|
93 |
-
ctx.send(file=discord.File(im)),
|
94 |
-
ctx.message.remove_reaction('β', bot.user),
|
95 |
-
ctx.message.add_reaction('β
')
|
96 |
-
)
|
97 |
|
98 |
'''
|
99 |
|
|
|
15 |
import shutil # for doing image movement magic
|
16 |
import concurrent.futures
|
17 |
# reboot
|
18 |
+
import multiprocessing
|
19 |
+
|
20 |
+
|
21 |
+
|
22 |
|
23 |
DFIF_TOKEN = os.getenv('HF_TOKEN')
|
24 |
DISCORD_TOKEN = os.environ.get("GRADIOTEST_TOKEN", None)
|
|
|
70 |
ctx.message.add_reaction('β
')
|
71 |
)
|
72 |
|
73 |
+
async def discord_after(ctx, im):
|
74 |
+
await asyncio.gather(
|
75 |
+
ctx.send(f'{ctx.author.mention} Here is the jojo version of it'),
|
76 |
+
ctx.send(file=discord.File(im)),
|
77 |
+
ctx.message.remove_reaction('β', bot.user),
|
78 |
+
ctx.message.add_reaction('β
')
|
79 |
+
)
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
#--------------------------------------------------------
|
85 |
+
def get_total_threads():
|
86 |
+
return multiprocessing.cpu_count()
|
87 |
+
|
88 |
+
total_threads = get_total_threads()
|
89 |
+
print("Total Threads:", total_threads)
|
90 |
+
|
91 |
+
|
92 |
def run_bot():
|
93 |
bot.run(DISCORD_TOKEN)
|
94 |
|
|
|
104 |
|
105 |
|
106 |
'''
|
107 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
'''
|
110 |
|