Fix: Moved the Files around due to imports not working right

Feat: Phoebe replies but it's gibbish
This is a version break because of the file structure change.
This commit is contained in:
Dan
2024-05-15 20:13:35 -04:00
parent 12071fbf61
commit 75f1116b3b
4 changed files with 116 additions and 20 deletions

35
phoebe/discord_bot.py Normal file
View File

@ -0,0 +1,35 @@
import discord
import os
from dotenv import load_dotenv
from train_gpt_model import process_message
from gpt_model import load_model
load_dotenv()
# Discord bot token
TOKEN = os.getenv("DISCORD_TOKEN")
# Initialize Discord client
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print(f"We have logged in as {client.user}")
load_model(5641, "phoebe_model.pt")
@client.event
async def on_message(message):
if message.author == client.user:
return
# Process the message and get a response
response = process_message(message.content)
# Send the response back to the Discord channel
await message.channel.send(response)
client.run(TOKEN)