added rnn
This commit is contained in:
parent
03fc4cadff
commit
5c4c6631ba
2 changed files with 10 additions and 2 deletions
|
@ -1,20 +1,28 @@
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
from textgenrnn import textgenrnn
|
||||||
|
|
||||||
class Responses(commands.Cog):
|
class Responses(commands.Cog):
|
||||||
|
|
||||||
def __init__(self, client):
|
def __init__(self, client):
|
||||||
self.client = client
|
self.client = client
|
||||||
|
self.model = textgenrnn("data/textgenrnn_weights.hdf5")
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_message(self, message: discord.Message):
|
async def on_message(self, message: discord.Message):
|
||||||
|
if message.author == self.client.user:
|
||||||
|
print("Cock")
|
||||||
|
return
|
||||||
|
|
||||||
# @applesauce
|
# @applesauce
|
||||||
if ("<@!568271450176356352>" in message.content) and ("<@!657709911337074698>" in message.content):
|
if ("<@!568271450176356352>" in message.content) and ("<@!657709911337074698>" in message.content):
|
||||||
await message.channel.send(f"Stop pinging us {message.author.mention} <:pinged:451198700832817202>")
|
await message.channel.send(f"Stop pinging us {message.author.mention} <:pinged:451198700832817202>")
|
||||||
return
|
return
|
||||||
|
|
||||||
if "<@!657709911337074698>" in message.content:
|
if "<@!657709911337074698>" in message.content:
|
||||||
await message.channel.send(f"{message.author.mention} <:pinged:451198700832817202>")
|
print("In")
|
||||||
|
result = self.model.generate(temperature=0.7, return_as_list=True)[0]
|
||||||
|
await message.channel.send(result)
|
||||||
return
|
return
|
||||||
|
|
||||||
if message.author.id == 478006431589728259:
|
if message.author.id == 478006431589728259:
|
||||||
|
|
BIN
data/textgenrnn_weights.hdf5
Normal file
BIN
data/textgenrnn_weights.hdf5
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue