Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Synced repo using 'sync_with_huggingface' Github Action
Browse files
app.py
CHANGED
@@ -24,6 +24,7 @@ def convert_to_timezone(dt, tz):
|
|
24 |
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
25 |
intents = discord.Intents.all()
|
26 |
bot = commands.Bot(command_prefix='!', intents=intents)
|
|
|
27 |
|
28 |
#rate_limiter = RateLimiter(max_calls=10, period=60) # needs testing
|
29 |
|
@@ -42,7 +43,11 @@ async def on_message(message):
|
|
42 |
"""Backup"""
|
43 |
number_of_messages = number_of_messages + 1
|
44 |
message_link = f"[#{message.channel.name}]({message.jump_url})"
|
45 |
-
|
|
|
|
|
|
|
|
|
46 |
|
47 |
"""Antispam"""
|
48 |
#Detecting certain unwanted strings
|
|
|
24 |
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
25 |
intents = discord.Intents.all()
|
26 |
bot = commands.Bot(command_prefix='!', intents=intents)
|
27 |
+
test = Client("https://lunarflu-bert-test.hf.space/--replicas/58fjw/")
|
28 |
|
29 |
#rate_limiter = RateLimiter(max_calls=10, period=60) # needs testing
|
30 |
|
|
|
43 |
"""Backup"""
|
44 |
number_of_messages = number_of_messages + 1
|
45 |
message_link = f"[#{message.channel.name}]({message.jump_url})"
|
46 |
+
job = test.submit("hi", api_name="/predict")
|
47 |
+
while not job.done():
|
48 |
+
await asyncio.sleep(0.2)
|
49 |
+
#await bot.log_channel.send( later, after testing
|
50 |
+
dm_message = await lunarflu.send(f"{number_of_messages}| {job.outputs()[0]['label']}| {message_link} |{message.author}: {message.content}")
|
51 |
|
52 |
"""Antispam"""
|
53 |
#Detecting certain unwanted strings
|