removing commands for huggingbot so they don't conflict with individualbots, see https://github.com/huggingface/discord-bots/pull/30
Browse files
app.py
CHANGED
@@ -39,99 +39,6 @@ async def on_ready():
|
|
39 |
print("------")
|
40 |
|
41 |
|
42 |
-
@client.hybrid_command(
|
43 |
-
name="falcon180b",
|
44 |
-
with_app_command=True,
|
45 |
-
description="Enter some text to chat with the bot! Like this: /falcon180b Hello, how are you?",
|
46 |
-
)
|
47 |
-
@app_commands.guilds(MY_GUILD)
|
48 |
-
async def falcon180b(ctx, prompt: str):
|
49 |
-
"""Command that begins a new conversation with Falcon180b"""
|
50 |
-
try:
|
51 |
-
await falcon_chat(ctx, prompt)
|
52 |
-
except Exception as e:
|
53 |
-
print(f"Error: {e}")
|
54 |
-
|
55 |
-
|
56 |
-
@client.hybrid_command(
|
57 |
-
name="codellama",
|
58 |
-
with_app_command=True,
|
59 |
-
description="Enter a prompt to generate code!",
|
60 |
-
)
|
61 |
-
@app_commands.guilds(MY_GUILD)
|
62 |
-
async def codellama(ctx, prompt: str):
|
63 |
-
"""Audioldm2 generation"""
|
64 |
-
try:
|
65 |
-
await try_codellama(ctx, prompt)
|
66 |
-
except Exception as e:
|
67 |
-
print(f"Error: (app.py){e}")
|
68 |
-
|
69 |
-
|
70 |
-
@client.event
|
71 |
-
async def on_message(message):
|
72 |
-
"""Checks channel and continues Falcon conversation if it's the right Discord Thread"""
|
73 |
-
try:
|
74 |
-
if not message.author.bot:
|
75 |
-
await continue_chat(message)
|
76 |
-
await continue_codellama(message)
|
77 |
-
except Exception as e:
|
78 |
-
print(f"Error: {e}")
|
79 |
-
|
80 |
-
|
81 |
-
@client.hybrid_command(
|
82 |
-
name="deepfloydif",
|
83 |
-
with_app_command=True,
|
84 |
-
description="Enter a prompt to generate an image! Can generate realistic text, too!",
|
85 |
-
)
|
86 |
-
@app_commands.guilds(MY_GUILD)
|
87 |
-
async def deepfloydif(ctx, prompt: str):
|
88 |
-
"""DeepfloydIF stage 1 generation"""
|
89 |
-
try:
|
90 |
-
await deepfloydif_generate64(ctx, prompt, client)
|
91 |
-
except Exception as e:
|
92 |
-
print(f"Error: {e}")
|
93 |
-
|
94 |
-
|
95 |
-
@client.hybrid_command(name="musicgen", with_app_command=True, description="Enter a prompt to generate music!")
|
96 |
-
@app_commands.guilds(MY_GUILD)
|
97 |
-
async def musicgen(ctx, prompt: str, seed: int = None):
|
98 |
-
"""Generates music based on a prompt"""
|
99 |
-
if seed is None:
|
100 |
-
seed = random.randint(1, 10000)
|
101 |
-
try:
|
102 |
-
await music_create(ctx, prompt, seed)
|
103 |
-
except Exception as e:
|
104 |
-
print(f"Error: {e}")
|
105 |
-
|
106 |
-
|
107 |
-
@client.hybrid_command(
|
108 |
-
name="audioldm2",
|
109 |
-
with_app_command=True,
|
110 |
-
description="Enter a prompt to generate music!",
|
111 |
-
)
|
112 |
-
@app_commands.guilds(MY_GUILD)
|
113 |
-
async def audioldm2(ctx, prompt: str):
|
114 |
-
"""Audioldm2 generation"""
|
115 |
-
try:
|
116 |
-
await audioldm2_create(ctx, prompt)
|
117 |
-
except Exception as e:
|
118 |
-
print(f"Error: (app.py){e}")
|
119 |
-
|
120 |
-
|
121 |
-
@client.hybrid_command(
|
122 |
-
name="wuerstchen",
|
123 |
-
with_app_command=True,
|
124 |
-
description="Enter a prompt to generate art!",
|
125 |
-
)
|
126 |
-
@app_commands.guilds(MY_GUILD)
|
127 |
-
async def wuerstchen_command(ctx, prompt: str):
|
128 |
-
"""Wuerstchen generation"""
|
129 |
-
try:
|
130 |
-
await run_wuerstchen(ctx, prompt, client)
|
131 |
-
except Exception as e:
|
132 |
-
print(f"Error wuerstchen: (app.py){e}")
|
133 |
-
|
134 |
-
|
135 |
def run_bot():
|
136 |
client.run(DISCORD_TOKEN)
|
137 |
|
|
|
39 |
print("------")
|
40 |
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
def run_bot():
|
43 |
client.run(DISCORD_TOKEN)
|
44 |
|