Spaces:
Runtime error
Runtime error
Synced repo using 'sync_with_huggingface' Github Action
Browse files- app.py +25 -4
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -4,6 +4,8 @@ import os
|
|
| 4 |
import threading
|
| 5 |
from threading import Event
|
| 6 |
|
|
|
|
|
|
|
| 7 |
import discord
|
| 8 |
import gradio as gr
|
| 9 |
from discord.ext import commands
|
|
@@ -161,10 +163,29 @@ def run_bot():
|
|
| 161 |
threading.Thread(target=run_bot).start()
|
| 162 |
event.wait()
|
| 163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
with gr.Blocks() as demo:
|
| 165 |
-
gr.Markdown("""
|
| 166 |
-
# Discord bot of https://huggingface.co/spaces/
|
| 167 |
-
|
| 168 |
""")
|
| 169 |
|
| 170 |
-
demo.launch()
|
|
|
|
| 4 |
import threading
|
| 5 |
from threading import Event
|
| 6 |
|
| 7 |
+
# test
|
| 8 |
+
|
| 9 |
import discord
|
| 10 |
import gradio as gr
|
| 11 |
from discord.ext import commands
|
|
|
|
| 163 |
threading.Thread(target=run_bot).start()
|
| 164 |
event.wait()
|
| 165 |
|
| 166 |
+
welcome_message = """
|
| 167 |
+
## Add this bot to your server by clicking this link:
|
| 168 |
+
|
| 169 |
+
https://discord.com/api/oauth2/authorize?client_id=1152238037355474964&permissions=309237647360&scope=bot
|
| 170 |
+
|
| 171 |
+
## How to use it?
|
| 172 |
+
|
| 173 |
+
The bot can be triggered via `/codellama` followed by your text prompt.
|
| 174 |
+
|
| 175 |
+
This will generate text based on the text prompt and create a thread for the discussion.
|
| 176 |
+
|
| 177 |
+
To continue the conversation, simply ask additional questions in the thread - no need for repeating the command!
|
| 178 |
+
|
| 179 |
+
⚠️ Note ⚠️: Please make sure this bot's command does have the same name as another command in your server.
|
| 180 |
+
|
| 181 |
+
⚠️ Note ⚠️: Bot commands do not work in DMs with the bot as of now.
|
| 182 |
+
"""
|
| 183 |
+
|
| 184 |
+
|
| 185 |
with gr.Blocks() as demo:
|
| 186 |
+
gr.Markdown(f"""
|
| 187 |
+
# Discord bot of https://huggingface.co/spaces/codellama/codellama-13b-chat
|
| 188 |
+
{welcome_message}
|
| 189 |
""")
|
| 190 |
|
| 191 |
+
demo.launch()
|
requirements.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
discord.py
|
| 2 |
-
gradio
|
|
|
|
| 1 |
discord.py
|
| 2 |
+
gradio
|