This repo contains code to create an AI replica of Elon Musk that can chat and moderate user interactions on Discord. Its conversation abilities come from Microsoft's DialoGPT conversational model that I fine-tuned on conversation transcripts of Elon Musk's appearance on the Joe Rogan Experience, the Lex Fridman Podcast and a Clubhouse interview. Its moderation abilities come from Unitary's Multilingual Toxic Comment Classifier allowing it to assess the toxicity of a message, warn users when they're using foul language and kick them out of the server after 3 strikes.
Wanna try it out? Here's an invite link to the Discord server (read message history is disabled).
Invite link: https://discord.gg/kTgvqAWWx8
Here is a demo of a conversation about Tesla:
Here is a demo of a conversation about colonizing Mars:
Here is a demo of a conversation about bitcoin and dogecoin, along with an example of an abusive user getting kicked out:
You can also directly chat with the model hosted on Hugging Face's Model Hub:
- Intelligent(ish) chatting
- Automated responses to messages about bitcoin and dogecoin
- Detecting toxic messages in multiple languages and reacting to them
- Kicking users out of server after 3 instances of toxic messages
- Tells users how many strikes they have (message
!kick
to use this functionality)
- data: Folder containing webscraped transcripts from Elon's interviews on Clubhouse and the Lex Fridman podcast, as well as a ready-to-use dataset retrieved from Kaggle of Elon's interview on the Joe Rogan Experience
- elon_bot.ipynb: Notebook for processing transcripts, fine tuning the DialoGPT model on the Elon's interview transcripts and pushing the fine-tuned model to Hugging Face
- main.py: Python script for all Discord bot functionalities
- keep_alive.py: Python script allowing bot to stay up
None of this work would have been possible without the following immensly valuable public contributions:
- freeCodeCamp's amazing tutorial: Code a Discord Bot with Python - Host for Free in the Cloud
- Lynn Zheng's great tutorial on freeCodeCamp and repo, as well as Rostyslav Neskorozhenyi's great Medium article and Colab notebook for fine tuning Microsoft's DialoGPT conversational model to have conversations with a video game or movie character
- Nathan Cooper's awesome tutorial on creating open-dialog chatbots
- Dale Markowitz's insightful post on building your own AI moderator bot for Discord
Any contributions you make are really helpful!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingContribution
) - Commit your Changes (
git commit -m 'Add some AmazingContribution'
) - Push to the Branch (
git push origin feature/AmazingContribution
) - Open a Pull Request
Does something seem off? Make sure to report it.