rian-kh / DiscordMessages-AI

AI-generated messages using GPT-2 trained on your Discord Data Package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DiscordMessages-AI

A program that uses your Discord message information from your Discord Data Package to create AI-generated messages trained using GPT-2.

Screen Shot 2023-05-09 at 10 54 34 PM Screen Shot 2023-05-09 at 8 48 52 PM

Important Notes:

  • This program uses gpt-2-simple and PySimpleGUI.
  • gpt_2_simple/gpt_2.py was modified to display steps of training/generation (Issue #1)
  • Do NOT exit/terminate training during saving, as this has a chance of reverting all training done no matter the steps.
  • Process management is REALLY bad in this, make sure to check for any python3.9 processes still running after exiting!!!
  • Does not work properly on Windows, only macOS (Apple Silicon) works for sure (See Issue #14)

Installation

Windows (using CPU)

  1. Set up a Python virtual environment with the following:
  • Python (latest)
  • gpt_2_simple (latest)
  • PySimpleGUI (latest)
  1. Unzip the DiscordMessages-AI repository into an IDE's project folder (like PyCharm).
  2. Go to your environment executable folder and drag the site-packages folder from the unzipped repository into it. (Will replace some files)
  3. Run main.py using the respective Python environment.

Windows (using GPU)

  1. Set up a conda virtual environment with the following (refer to Tensorflow w/ GPU installation):
  • Python 3.9
  • Tensorflow 2.10
  • CUDA Toolkit 11.2
  • cuDNN 8.1.0
  • gpt_2_simple (latest)
  • PySimpleGUI (latest)
  1. Unzip the DiscordMessages-AI repository into an IDE's project folder (like PyCharm).
  2. Go to your environment executable folder and drag the site-packages folder from the unzipped repository into it. (Will replace some files)
  3. Run main.py using the respective Python environment.

macOS (Apple Silicon)

  1. Set up a conda virtual environment with the following (refer to tensorflow-metal Installation):
  • Python 3.9
  • gpt_2_simple (latest). Make sure to uninstall the tensorflow dependency it'll come with, and use tensorflow-macos instead!
  • tensorflow-deps (Latest)
  • tensorflow-macos (Latest)
  • tensorflow-metal (Latest)
  • PySimpleGUI (latest)
  1. Unzip the DiscordMessages-AI repository into an IDE's project folder (like PyCharm).
  2. Go to your environment executable folder and drag the site-packages folder from the unzipped repository into it. (Will replace some files)
  3. Run main.py using the respective Python environment.

Usage

Training the model

  1. Download your Discord Data Package as package.zip.
  2. Browse for your package and generate your dataset.
  3. Set training parameters and train for however many steps you want. Train for at least 200 steps for it to adopt your messaging patterns, and ~5000 for best output (less randomness, less out-of-character messages)
  4. Press "Save and end training" when you want to finish training, before moving on.

Generating messages with the model

  1. Switch to the "Test model" tab and set generation parameters. Keep the number of samples higher (>5) as it's faster to generate more samples in a row than generate them individually.
  2. If you want to end sample generation prematurely, press "End text generation".

About

AI-generated messages using GPT-2 trained on your Discord Data Package

License:GNU General Public License v3.0


Languages

Language:Python 100.0%